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 
 
Hide Gamespy account

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Wed Feb 10, 2016 21:42    Post subject: Hide Gamespy account Reply with quote

Hello everybody,

I want to know if there exists some plugin that is able to activate/deactivate the possibility to see the gamespy account of a player in game.
This could be really useful for masked/hidden thief or killer that do not want to show their identity.

I already implemented a new system of "Dynamic Names" based on nwnx_names but it is still weak if account name is visibile Smile

I checked nwnx_events and nwnx_chat and nwnx_visibility but no body of them is doing this job.

If it does not exist, can somebody drive me how to make this extension? (maybe for nwnx_chat)
Back to top
View user's profile Send private message Visit poster's website
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Feb 11, 2016 17:45    Post subject: Reply with quote

nwnx_fixes allows you to disable the playerlist.

It means no players will be able to see any other players in the player invite screen, or in the player list on the join screen.

With nwnx_chat - you could potentially hook the chat event, before the message is delivered, and replace the senders name with something like ??????.
If it takes an object ID, you could change the object ID to an NPC's or objects. Thats basically how the /vent command works.
Back to top
View user's profile Send private message
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Thu Feb 09, 2017 16:21    Post subject: Reply with quote

Baaleos wrote:
nwnx_fixes allows you to disable the playerlist.

It means no players will be able to see any other players in the player invite screen, or in the player list on the join screen.

With nwnx_chat - you could potentially hook the chat event, before the message is delivered, and replace the senders name with something like ??????.
If it takes an object ID, you could change the object ID to an NPC's or objects. Thats basically how the /vent command works.


This is a good way to solve the problem in case we talk about the channel 'tell' (Private Message).

However, let's think about the channel Talk.
I am talking and what I said is appearing on the top of my character.
I could potentially substitute the "speaker" with an invisible object.
I would face 2 problems:
1) what I said appears on the top of the invisible object and not on the top of my character (that looks so bad)
2) If the object is invisibile, I would see the text only on the chat bar.

I notice that when we use "PlayVoice", actually we have the behavior that I would like to have (people can't see my gamespy account with a click on the portrait in the chat bar).

Any ideas?
Another way would be to create a plugin that does it.
The problem is that I do not understand how you guys are able to hook the event.

There is some guides about "How to create NWNX hook?"
Back to top
View user's profile Send private message Visit poster's website
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Feb 10, 2017 17:37    Post subject: Reply with quote

The client knows all account names (it receives a list of all logged in characters & their accounts when entering the game & also receives new names+accounts when they join). So you need to modify that data, that way the client will still translate names to PlayerIDs when talking to the server, but the names will not correspond to real account names.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Feb 10, 2017 17:44    Post subject: Reply with quote

More specifically, you need to hook these two methods:
CNWSMessage::SendServerToPlayerPlayerList_All(CNWSPlayer *)
CNWSMessage::SendServerToPlayerPlayerList_Add(unsigned long, CNWSPlayer *)
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Tue May 09, 2017 11:55    Post subject: Reply with quote

virusman wrote:
More specifically, you need to hook these two methods:
CNWSMessage::SendServerToPlayerPlayerList_All(CNWSPlayer *)
CNWSMessage::SendServerToPlayerPlayerList_Add(unsigned long, CNWSPlayer *)


These functions can be found in Names.

I tried to work with "SendServerToPlayerPlayerList_Add" but there are problems. The player are not considered as PC and it seems to obtain "strange" behavior.

I have seen that in names, the names of all the player is updated.
Then the question is: why can not I update also the account name?

However I am not able to find where to modify it.
Which is the class and the method that allows me to get the account name and modify it?

I have done it for NWNX Auth but the function is hooked too early and I cannot see my players in the list (i enter as AccountX and the list is of AccountY)
Back to top
View user's profile Send private message Visit poster's website
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Tue May 09, 2017 14:54    Post subject: Reply with quote

metagamer wrote:
virusman wrote:
More specifically, you need to hook these two methods:
CNWSMessage::SendServerToPlayerPlayerList_All(CNWSPlayer *)
CNWSMessage::SendServerToPlayerPlayerList_Add(unsigned long, CNWSPlayer *)


These functions can be found in Names.

I tried to work with "SendServerToPlayerPlayerList_Add" but there are problems. The player are not considered as PC and it seems to obtain "strange" behavior.

I have seen that in names, the names of all the player is updated.
Then the question is: why can not I update also the account name?

However I am not able to find where to modify it.
Which is the class and the method that allows me to get the account name and modify it?

I have done it for NWNX Auth but the function is hooked too early and I cannot see my players in the list (i enter as AccountX and the list is of AccountY)


I am moving forward.

Now I decided to avoid nwnx_names and focus on nwnx_connect to understand how to extract the GameSpay name.
And it works.

Hooking:
void SendServerToPlayerPlayerList_All_Hook(CNWSMessage *pMessage, CNWSPlayer *pPlayer)

I can extract the GetPlayerName of an object.
However, I would like to SET it.

Anyidea about it? I am working with assembly trying to understand how to modify it.

I already made an extension of CExoString class to set manually the variable and it works.
This was working for nwnx_auth. The code was easy:

Code:
void CNetLayerInternal__HandleBNCSMessage_mid_Hook()
{
    asm("leave");
    asm("pusha");

    asm("lea -0x38(%ebp), %eax");
    asm("mov %eax, sCDKey");
    asm("lea -0x28(%ebp), %eax");
    asm("mov %eax, sAccount");

    sAccountFake->Set("test")
...
}


In such way I was able to set the new account by the method Set_Text.

The challenge now is to do the same in nwnx_connect.
It should be something like:

Code:
void SendServerToPlayerPlayerList_All_Hook(CNWSMessage *pMessage, CNWSPlayer *pPlayer)
{
 
    asm("mov $0x0805e980, %eax");
    asm("mov sAccountFake, %eax");
   
    sAccountFake->Set("test") 

}

    NX_HOOK(CNWSMessage__SendServerToPlayerPlayerList_All, 0x080774e4,
            SendServerToPlayerPlayerList_All_Hook, 12);


but of course it doesnt work :/
Back to top
View user's profile Send private message Visit poster's website
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Sat May 13, 2017 12:39    Post subject: Reply with quote

Glad to say that the aim of this topic has been reached and I extended and fixed nwnx_auth into nwnx_authv2
Back to top
View user's profile Send private message Visit poster's website
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon May 29, 2017 13:14    Post subject: Reply with quote

Great work! Could you share the source for this?
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Tue May 30, 2017 19:03    Post subject: Reply with quote

virusman wrote:
Great work! Could you share the source for this?


Yes I will. It is still unstable and it requires "hard" changement in the system.
Moreover, there are several collateral effect.

I will quickly explain.
It is not possible to modify the account after that the server hooked your account. You must modify the information that you are going to send to the server.

In other words, you cannot change the gamespy name after the authorization process but before (the hook of nwnx_auth)

However, this makes everything much more difficult.
What I did, it was to create a "fake" servervault account with 1000 different folder named "account_001, account_002, ...., account_999".
If you try to go over 999, you get a segmantation fault, memory error.
Maybe because generate a random value with 4 number is too expansive.

When this random number is generated, I check that it has not been generated yet. So there are 3 steps:
1 - Account random generated -> player is trying to connect (impossible to hook "cancel" when you are connecting)
2 - Account generated confirmed -> Player connected (the player can see his/her character list)
3 - Account removed -> Player disconnected

To do so, I modified:
- NWNX Auth for the step 1
- NWNX Connect for the step 2 and 3

I tried to connect with mysql to have a kind of "store" but it didn't work. I did it with "text" file but I still have some issues that I want to fix.

So, with some modification, the character are "moved" from a desired folder to the server vault folder.
My desired folder is inside ./nwn/accounts
My servervault folder is the normal ./nwn/folder

The process works, creating new folders, when a new character is created.

With NWNX_Auth, I am able to get the real account, modify it and memorized the real account and the currently fake account.

When the server crashes, the characters are obviously not transferred automatically from the fake account in servervault to their original account in "./nwn/accounts"

This is easy to fix with some bash script that check everything.

This kind of modification have a big impact on the game.
When a character enters, we store variables or anything else on it (let's think about local variable or campaign variable).
Campaign variable will not work if you use the parameter oPlayer because the account changes everytime.

For unknown reason (I guess because the server associate an object as character + account), when a player enters his final position is not recorded.
It means that everytime, we re-login at the starting-server-location.
Moreover, if you logout/login, the local variable are not stored.

So, I am working on this three parts.

If somebody is able to find a faster and easier solution, I could help him/her to develop this new kind of tool to mask the account.

PS: The hook that I used are
-> NWNX_Auth: I get the name account with CEXstring and I created a method to modify directly the content
-> NWNX_Connect: the hook when the character login (just before send Hak list) and log out.
Back to top
View user's profile Send private message Visit poster's website
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Jun 21, 2017 16:59    Post subject: Reply with quote

I did a proper implementation of this as outlined in my earlier post.
I can do account mapping as in nwnx_names, or call a script every time to get the account name to be displayed. What would you prefer?
DMs will see the original accounts, as before.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Wed Aug 09, 2017 22:54    Post subject: Reply with quote

virusman wrote:
I did a proper implementation of this as outlined in my earlier post.
I can do account mapping as in nwnx_names, or call a script every time to get the account name to be displayed. What would you prefer?
DMs will see the original accounts, as before.


it would be perfect like nwnx_names!
Back to top
View user's profile Send private message Visit poster's website
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Mon Nov 06, 2017 11:40    Post subject: Reply with quote

virusman wrote:
I did a proper implementation of this as outlined in my earlier post.
I can do account mapping as in nwnx_names, or call a script every time to get the account name to be displayed. What would you prefer?
DMs will see the original accounts, as before.


Some news?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
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