Author Topic: What's the function RTB calls to get what server a player is at?  (Read 724 times)

/title

I looked through console trace and System_ReturnToBlockland and didn't find anything that helped.


You can just read it off of the GUI, but it'll probably be hacky as it probably only is set as soon as you open the player info dialog or whatever. Or maybe not.

Edit: I found this, in this mod: http://forum.returntoblockland.com/dlm/viewFile.php?id=3835

function Connect2ChatConductor::GetOnlineFriends(%this)
{
   %Group = RTBCC_Roster.GetObject(0);
   
   %NameList = 0;
   
   if(IsObject(%Group))
   {
      %GroupCount = %Group.getCount();
      
      for(%i=0;%i<%groupCount;%i++)
      {
         %UserData = %Group.GetObject(%i);
         
         if(IsObject(%UserData))
         {
            if(%NameList $= "0")
            {
               %NameList = StrReplace(%UserData.Name," ","_");
            }
            else
            {
               %NameList = %NameList SPC StrReplace(%UserData.Name," ","_");
            }
         }
      }
   }
   return %NameList;
}


It looks like it only returns your friends names that are online. But maybe try dumping the group or maybe try dumping the %userdata object and see if it has any info. You can also try looking through the original mod but if that fails to help you, the only thing you can do is look through RTB itself (good luck).
« Last Edit: June 13, 2012, 06:37:25 PM by elm »

It's all through the chat connection so you're not going to find a function.

It's all through the chat connection so you're not going to find a function.

RTBCC_Roster.GetObject(0).getObject(0).dump(); It shows me the player's Ip and port of the server they are on.

Edit: Alternatively, you can do RTBCC_Roster.GetObject(0).getObject(0).info(); and read off of the info pane what server the player is on (as i previously said) etc.
« Last Edit: June 13, 2012, 06:47:45 PM by elm »

RTBCC_Socket.getUserInfo(%BLID);

And

RTBCC_Socket::onPlayerInfoResponse(%this,%parser,%packet)
{

...

%name = %packet.find("server/name").cData;


Snippet from connectClient.cs, lines 3377 and 1949-2088 respectively.

EDIT: It will only work if the target user has 'let anyone see the server i'm on' enabled, if that's off the only way to get it would be through hacking.
« Last Edit: June 13, 2012, 07:15:57 PM by Ipquarx »

EDIT: It will only work if the target user has 'let anyone see the server i'm on' enabled, if that's off the only way to get it would be through hacking.
This isn't true, you could pilfer RTB's server info off servers with RTB enabled and regardless of if the person has it checked they'll show up in that server list, or you could make a bot that joins servers, logs members, leaves. But then it'd just get banned.