logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Visibility Hook
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 15:57    Post subject: Reply with quote

I can't downlaod that. It shows 404 error. It's probably about that i'm not logged in to that repository.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 15:57    Post subject: Reply with quote

try again - I accidentally had https instead of http
Also added

http://asmodei.net/Downloads/nwnx_funcsNSS.rar

This is the nwnx_funcs.nss include file I use on my server.
So it should give an idea of the funtionality that the dll is capable of.
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 16:00    Post subject: Reply with quote

Great thx it works now!

Maybe there's a chance that you have other forgotten treasures like nwnx_dmactions? Wink
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 16:03    Post subject: Reply with quote

I have the dll, but not the source
Or if I do have the source, its hidden on a hdd somewhere in my house.

http://asmodei.net/Downloads/nwnx_dmactions.rar

Note - the nss is my own servers usage of the dll, so ignore anything that looks too specific, just customize as you need.

Updated the download to have the 2 nss fles required
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 16:11    Post subject: Reply with quote

Sweet! It's better than Christmas!

P.S. You have great collection. I'm back to nwn after 3 years and I've spend my last week on looking at 404 errors on old repos etc.

It's probably almost impossible to start from beginning now. I don't know if there's something more I should have but couldn't find because it's lost in 404 errors.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 16:28    Post subject: Reply with quote

I undoubtably have the sources for nwnx_funcs on my desktop at home.
Its just from years of using a stable binary that I never needed the sources after that.


I will see what I can find the sources for and try to host somewhere.

My full arsenal of dlls includes:

nwnx_areas - maxrocks version
nwnx_chat - simtools version
nwnx_cool - my own version with my damage hooks added
nwnx_dmactions
nwnx_dotnetplugin - my own modification to load further c# dlls at run time
nwnx_fixes - zebranskys version - has the hide dm / player code
nwnx_funcs - maxrocks last version
nwnx_leto - not really used these days
nwnx_magic - from terra's repo - havent found a use for it yet)
nwnx_names - virusmans - but doesnt appear to be stable for windwos
nwnx_odbc
nwnx_profiler - recently using this to try and optimize my cpu usage on the server
nwnx_resetplugin
nwnx_resman - use this alot for hosting external scripts etc
nwnx_resources - think this is terras version, does what resman does, but havent needed to use
nwnx_serverlist - adds server to new server list page
nwnx_systemdata2 -cmd commands etc
nwnx_time.dll - adds time functions, but I generally use my C# Functionality instead
nwnx_tmi - disables the TMI
nwnx_vaultster - allows transfer of character bic files across servers


My own .Net DLL's that I load into the server via the DotNet plugin include:

ForumServices.dll -Allows my nwn server to connect to my forum
TimeServices.dll - Used primarilly for getting UNIX timestamp without having to use SQL
Facebook.dll - Makes automated posts on our facebook page when people level up to 35+
RhunDownloaderServices.dll - Allows people who run our downloader application which sync's their override content with the server, to advertise that fact to the server.
NWNDotNet.dll - Adds a MainLoop hook : which allows external TCP connections to the server to execute script files on command
EMailServices.dll - Allows the server to send e-mails to recipients
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 16:50    Post subject: Reply with quote

Valgav wrote:
Sweet! It's better than Christmas!

P.S. You have great collection. I'm back to nwn after 3 years and I've spend my last week on looking at 404 errors on old repos etc.

It's probably almost impossible to start from beginning now. I don't know if there's something more I should have but couldn't find because it's lost in 404 errors.


If your interested in hosting for your nwn server- I can host for you at fairly reasonable prices.

Linux is obviously cheaper, but I do windows servers also - which are ideal for people unfamiliar with linux.
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 21:27    Post subject: Reply with quote

Last offtopic here Surprised

Damage hooks sounds quite interesting but I'm using Shadooow's version(his version has some unique events like learning scrolls) and my sources for are somehow broke and keep showing errors while compiling so I'm using also terra's events just for examin hook because I couldn't find good src and I'm just a beginner in coding for nwnx.

about nwnx_names, is that copy from terra's OneDrive? I'm using that one and only changing names on players list doesn't work without relog.

Your plugins for dotnet sounds like a game changer. I would really like to have a closer look at them.

Also I sent you PM with my e-mail and skype for easier communication and to prevent further offtopic here Wink
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 21:35    Post subject: Reply with quote

If your interested in the damage hook

http://www.nwnx.org/phpBB2/viewtopic.php?t=2111&start=15

The code is here, if you can get your own nwnx_cool to compile this hook is fairly simple to implement.

Lets you change the damage before it gets applied to your character.
Eg: Take 5 fire damage, and change it into Cold Damage or even cancel it altogether and heal 5 instead.

As for the DotNet plugins
https://www.dropbox.com/s/1hs685ik8etq2vx/DotNetPlugin.rar?dl=0

Zunath added this to dropbox
I dont know if it includes the ability to execute from other dlls.
As that was one of the last features I added to it.

Also - if you are interested in NWNDotNet - the one that adds the MainLoop hook.

https://github.com/Baaleos/NWNDotNet

This was originally done as a POC just to prove that Function and Method hooking can be done in C# in a similar manner to C++



Edit:
Just checked - the nwndotnet package seems to be up to date.
Use this in nss


Code:

//Executes methods and paramenters agains the DotNet Plugin
//The methods and parameters MUST exist in the Exection class of that Plugin
//The buffer size should be adjusted to fit the size of your expected return
//(if you inform a buffer lesser than expected results, it will be truncated)
//(parameters informed with {&qt} are ignored, once that string is reserved for the function)
string DotNetExecute(string MethodName, string Param1="{&qt}", string Param2="{&qt}", string Param3="{&qt}", string Param4="{&qt}", string Param5="{&qt}", string Param6="{&qt}", string Param7="{&qt}", string Param8="{&qt}", string Param9="{&qt}", string Param10="{&qt}", int BufferSize=500);

//Get the filler string based in the informed length.
string DotNetGetFiller(int Length);

//Encode quotes
string DotNetEncodeQuote(string sString);

//DotNetExecute("ExecuteClassCode", sClassFile, sMethodName, sArgs);
string DotNetExecute(string MethodName, string Param1="{&qt}", string Param2="{&qt}", string Param3="{&qt}", string Param4="{&qt}", string Param5="{&qt}", string Param6="{&qt}", string Param7="{&qt}", string Param8="{&qt}", string Param9="{&qt}", string Param10="{&qt}", int BufferSize=500) {
    //encode quotes
    //first, check it
    string strQuote = "{&qt}";
    int blnError = FALSE;
    if (Param1 != "{&qt}" && FindSubString(Param1, strQuote) >-1 ) { blnError = TRUE; }
    if (Param2 != "{&qt}" && FindSubString(Param2, strQuote) >-1 ) { blnError = TRUE; }
    if (Param3 != "{&qt}" && FindSubString(Param3, strQuote) >-1 ) { blnError = TRUE; }
    if (Param4 != "{&qt}" && FindSubString(Param4, strQuote) >-1 ) { blnError = TRUE; }
    if (Param5 != "{&qt}" && FindSubString(Param5, strQuote) >-1 ) { blnError = TRUE; }
    if (Param6 != "{&qt}" && FindSubString(Param6, strQuote) >-1 ) { blnError = TRUE; }
    if (Param7 != "{&qt}" && FindSubString(Param7, strQuote) >-1 ) { blnError = TRUE; }
    if (Param8 != "{&qt}" && FindSubString(Param8, strQuote) >-1 ) { blnError = TRUE; }
    if (Param9 != "{&qt}" && FindSubString(Param9, strQuote) >-1 ) { blnError = TRUE; }
    if (Param10 != "{&qt}" && FindSubString(Param10, strQuote) >-1 ) { blnError = TRUE; }
    if (blnError) {
        return "(error)Don't use the substring {&qt}, it is reserved";
    }
    //now, replace
    if (Param1 != "{&qt}" && FindSubString(Param1, "'") >-1 ) { Param1 = DotNetEncodeQuote(Param1); }
    if (Param2 != "{&qt}" && FindSubString(Param2, "'") >-1 ) { Param2 = DotNetEncodeQuote(Param2); }
    if (Param3 != "{&qt}" && FindSubString(Param3, "'") >-1 ) { Param3 = DotNetEncodeQuote(Param3); }
    if (Param4 != "{&qt}" && FindSubString(Param4, "'") >-1 ) { Param4 = DotNetEncodeQuote(Param4); }
    if (Param5 != "{&qt}" && FindSubString(Param5, "'") >-1 ) { Param5 = DotNetEncodeQuote(Param5); }
    if (Param6 != "{&qt}" && FindSubString(Param6, "'") >-1 ) { Param6 = DotNetEncodeQuote(Param6); }
    if (Param7 != "{&qt}" && FindSubString(Param7, "'") >-1 ) { Param7 = DotNetEncodeQuote(Param7); }
    if (Param8 != "{&qt}" && FindSubString(Param8, "'") >-1 ) { Param8 = DotNetEncodeQuote(Param8); }
    if (Param9 != "{&qt}" && FindSubString(Param9, "'") >-1 ) { Param9 = DotNetEncodeQuote(Param9); }
    if (Param10 != "{&qt}" && FindSubString(Param10, "'") >-1 ) { Param10 = DotNetEncodeQuote(Param10); }

    //get parameter count
    int intParamCount = 0;
    if (Param1 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param2 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param3 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param4 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param5 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param6 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param7 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param8 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param9 != "{&qt}") { intParamCount = intParamCount + 1; }
    if (Param10 != "{&qt}") { intParamCount = intParamCount + 1; }

    //build request string
    string strRequest = "";
    strRequest = "-m:'" + MethodName + "' -pc:'" + IntToString(intParamCount) + "' -p1:'" + Param1 + "'" + " -p2:'" + Param2 + "'" + " -p3:'" + Param3 + "'" + " -p4:'" + Param4 + "'" + " -p5:'" + Param5 + "'" + " -p6:'" + Param6 + "'" + " -p7:'" + Param7 + "'" + " -p8:'" + Param8 + "'" + " -p9:'" + Param9 + "'" + " -p10:'" + Param10 + "' ";
    //PrintString(strRequest);

    //set filler
    if (GetStringLength(strRequest) < BufferSize) {
        strRequest = strRequest + DotNetGetFiller(BufferSize-GetStringLength(strRequest));
    }

    //execute
    SetLocalString(GetModule(), "NWNX!DOTNETPLUGIN!EXECUTE", strRequest);

    //return
    return GetLocalString(GetModule(), "NWNX!DOTNETPLUGIN!EXECUTE");
}

string DotNetGetFiller(int Length) {
    if (Length > 0) {
        int i = 0;
        string strReturn = "....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................";
        while (GetStringLength(strReturn) < Length) {
            strReturn = strReturn + strReturn;
            i++;
            if (i>50) break;
        }
        return GetSubString(strReturn, 0, Length);
    }
    else {
        return "";
    }
}

string DotNetEncodeQuote(string sString)
{
    if (FindSubString(sString, "'") == -1)      // not found
        return sString;

    int i;
    string sReturn = "";
    string sChar;

    // Loop over every character and replace special characters
    for (i = 0; i < GetStringLength(sString); i++)
    {
        sChar = GetSubString(sString, i, 1);
        if (sChar == "'")
            sReturn += "{&qt}";
        else
            sReturn += sChar;
    }
    return sReturn;
}



string RunDLLMethod(string sDLL, string sNameSpace, string sClassName, string sMethod, string sArgs)
{
    return DotNetExecute("ExecuteAssembly", sDLL, sNameSpace, sClassName, sMethod, sArgs);
}

string RunClassMethod(string sClassFile, string sMethodName, string sArgs)
{
    return DotNetExecute("ExecuteClassCode", sClassFile, sMethodName, sArgs);
}



Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 23:05    Post subject: Reply with quote

Am I just stupid or code from nwnx_cool link doesn't have CreateHook part which is important?

Also I tried to compile my own cool from this one(Shadooow's version) but I'm unable to compile the source even without modifications. So I'm not sure if it's me, my Visual Studio or something is broken in that code.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 19, 2015 23:17    Post subject: Reply with quote

Can you post the errors?
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Feb 19, 2015 23:22    Post subject: Reply with quote

I'm using Visual Studio 2013 Ultimate (profits of being student). I deleted all unused projects and left only nwnx_cool and NWNXdll and errors are:


Code:
Error   1   error C2065: 'CExoArrayList_string' : undeclared identifier   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   2   error C2065: 'list' : undeclared identifier   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   3   error C2275: 'CExoString' : illegal use of this type as an expression   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   4   error C2146: syntax error : missing ')' before identifier 'val'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   5   error C2433: 'CExoArrayList_string_add' : 'inline' not permitted on data declarations   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   6   error C2059: syntax error : ')'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   7   error C2143: syntax error : missing ';' before '{'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   8   error C2447: '{' : missing function header (old-style formal list?)   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   9   error C2062: type 'int' unexpected   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   10   error C2059: syntax error : 'if'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   11   error C2059: syntax error : 'return'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   12   error C2059: syntax error : '}'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   13   error C2059: syntax error : 'for'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   14   error C2143: syntax error : missing ')' before ';'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   15   error C2143: syntax error : missing ';' before '<'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   16   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   17   error C2143: syntax error : missing ';' before '++'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   18   error C2086: 'int i' : redefinition   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   19   error C2059: syntax error : 'else'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CExoArrayList.h   107   1   nwnx_cool
Error   20   error C2143: syntax error : missing ';' before '{'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\Vector.h   27   1   nwnx_cool
Error   21   error C2447: '{' : missing function header (old-style formal list?)   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\Vector.h   27   1   nwnx_cool
Error   22   error C2079: 'CScriptLocation_s::loc_position' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CScriptLocation.h   28   1   nwnx_cool
Error   23   error C2079: 'CScriptLocation_s::loc_orientation' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CScriptLocation.h   29   1   nwnx_cool
Error   24   error C2079: 'CNWSObject_s::obj_position' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CNWSObject.h   40   1   nwnx_cool
Error   25   error C2079: 'CNWSObject_s::obj_orientation' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CNWSObject.h   41   1   nwnx_cool
Error   26   error C2079: 'CNWSObject_s::obj_last_spell_location' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CNWSObject.h   120   1   nwnx_cool
Error   27   error C2146: syntax error : missing ';' before identifier 'HakList'   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CNWSModule.h   32   1   nwnx_cool
Error   28   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   c:\users\ksawery\desktop\nwnx cool\src\nwn_internals\CNWSModule.h   32   1   nwnx_cool
Warning   29   warning C4005: '_CRT_SECURE_NO_WARNINGS' : macro redefinition   c:\users\ksawery\desktop\nwnx cool\src\nwnx_cool\iplist.h   24   1   nwnx_cool
Error   30   error C2079: 'CNWNXCool::vTarget' uses undefined struct 'Vector_s'   c:\users\ksawery\desktop\nwnx cool\src\nwnx_cool\NWNXCool.h   60   1   nwnx_cool
Error   31   error C2228: left of '.x' must have class/struct/union   C:\Users\Ksawery\Desktop\NWNX Cool\SRC\nwnx_cool\CCoolFunc.cpp   289   1   nwnx_cool
Error   32   error C2228: left of '.y' must have class/struct/union   C:\Users\Ksawery\Desktop\NWNX Cool\SRC\nwnx_cool\CCoolFunc.cpp   289   1   nwnx_cool
Error   33   error C2228: left of '.z' must have class/struct/union   C:\Users\Ksawery\Desktop\NWNX Cool\SRC\nwnx_cool\CCoolFunc.cpp   289   1   nwnx_cool
Warning   34   warning C4244: '=' : conversion from 'int' to 'float', possible loss of data   C:\Users\Ksawery\Desktop\NWNX Cool\SRC\nwnx_cool\CCoolFunc.cpp   810   1   nwnx_cool
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Feb 20, 2015 12:34    Post subject: Reply with quote

those errors look like the include directories arent being picked up

Try and configure your project settings to have additional include diectories and direct it towards the directories where those errors are referring to files.
EG: CExoArrayList_string cannot be located, so locate it yourself, then point an include directory at it.
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Fri Feb 20, 2015 14:57    Post subject: Reply with quote

I added path to nwn_internals to sources in project but I'm still getting some errors.

I think there's a simple solution but I'm not enough expirienced programmer to find it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group