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
I'm having trouble disconnecting properly.
"myConnection.Disconnect();" successfully disconnects the bot, but you continue to see the ghost of the bot until you refresh the page.
I know this can be fixed somehow, because once you close the program entirely, the ghost goes away. However, I don't want to have to close the program every time I want it to disconnect.
The code:
public static Connection Conn; static string GameID = "everybody-edits-su9rn58o40itdbnw69plyw"; static string GameVersion = "Everybodyedits145"; public static string Name; public static string Pass; public static string Room; public static void Connect() { try { Client client = PlayerIO.QuickConnect.SimpleConnect(GameID, Name, Pass); Conn = client.Multiplayer.CreateJoinRoom(Room, GameVersion, true, new Dictionary<string, string>(), new Dictionary<string, string>()); Conn.OnMessage += onMessage; Conn.Send("init"); Conn.Send("init2"); } catch (PlayerIOError e) { Convert.ToString(e.Source); } }
The connection is controlled by a Thread:
public static Thread Run = new Thread (new ThreadStart(Connect));
Run.Start();
And terminated by:
Conn.Disconnect();
Run.Abort();
Any help?
Yeah, well, you know that's just like, uh, your opinion, man.
Offline
A thread runns asynchronous as the others and your bot, I take on you use console, closes after finnishing the commands.
= the console is done before the thread and closes, but the thread still runns = ghosted bot
EDIT: eeversion is 147 and you can declare multiple variables with:
public static int variable00, variable01, variable02;
Last edited by Krock (Jan 6 2013 1:59:47 pm)
Offline
A thread runns asynchronous as the others and your bot, I take on you use console, closes after finnishing the commands.
= the console is done before the thread and closes, but the thread still runns = ghosted bot
Thanks a bunch.
I actually just replaced the thread with a single call to Connect() and it worked out.
I'm sure the outdated version didn't help either.
Yeah, well, you know that's just like, uh, your opinion, man.
Offline
Pages: 1
Topic closed
[ Started around 1732463646.9019 - Generated in 0.044 seconds, 10 queries executed - Memory usage: 1.4 MiB (Peak: 1.51 MiB) ]