Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
How would I separate the different clients from each other so they do different things. This is probably something easily easy but... I'm a scrub.
Here's my connection code :
static void Main(string[] args)
{
try
{
//Don't forget to set up PlayerIO.
string worldId = "PWVANwQ-Vwb0I";
#region pass
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "s************[email protected]"/* email */, "THECORRECTPASSWORDGOESHERE"/* password */, null);
#endregion
string serverVersion = (worldId.StartsWith("BW") ? "Beta" : "Everybodyedits") + client.BigDB.Load("config", "config")["version"];
connection = client.Multiplayer.CreateJoinRoom(worldId, serverVersion, true, null, null);
connection.OnMessage += OnMessage;
connection.Send("init");
string worldId2 = "PWsj-y71kMbEI";
#region pass
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "[email protected]"/* email */, "botaccount"/* password */, null);
#endregion
connection = client.Multiplayer.CreateJoinRoom(worldId2, serverVersion, true, null, null);
connection.OnMessage += OnMessage;
connection.Send("init");
Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
Offline
Hmm was someone else that requested the same. Use lists, dictionary or array for the connections.
Offline
Offline
Offline
You are putting this piece of code twice:
connection.OnMessage += OnMessage;
Like capasha said, use a an array, a list or whatever you like using to store multiple data,(or different variables for the 2 connections), then set the second one to be linked to a different OnMessage, something like
connection2.OnMessage += OnMessage2;
Offline
Offline
Would it be possible to use the same function for the onmessage? I'm thinking yes. (but haven't tried)
Then you won't have to create 50 of teh same function for no reason!
It should behave normally if you bind all connections to the same OnMessage(not tested), but I'm giving him this solution because he wants to make 2 different scripts.
Offline
▼Account info leaked
super legit account info that has all the blocks and everything on here.
Offline
Locked on request of owner.
"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto
Offline
Pages: 1
Topic closed
[ Started around 1732781292.3648 - Generated in 0.050 seconds, 12 queries executed - Memory usage: 1.46 MiB (Peak: 1.61 MiB) ]