Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Client client;
- public Connection conn;
- public bool iscon;
- public Dictionary<int, string> players = new Dictionary<int, string>();
- /*^^^ Put these after
- "public partial class Form1 : Form
- {"*/
- //this goes in button
- if (!iscon)
- {
- client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "email", "pw", null);
- conn = client.Multiplayer.CreateJoinRoom("worldID", "Everybodyedits" + client.BigDB.Load("config", "config")["version"], true, new Dictionary<string, string>(), new Dictionary<string, string>());
- conn.Send("init");
- conn.OnMessage += new MessageReceivedEventHandler(onmessage);
- iscon = true;
- }
- else
- {
- conn.Disconnect();
- iscon = false;
- }
- //until here
- //goes outside button
- #region Cases
- public void onmessage(object o, PlayerIOClient.Message m)
- {
- Invoke(new EventHandler(delegate
- {
- switch (m.Type)
- {
- #region Init
- case "init":
- {
- conn.Send("init2");
- conn.Send("god", true);//gives bot god mode
- }
- break;
- #endregion
- #region Add
- case "add":
- {
- if (!players.ContainsKey(m.GetInt(0)))
- {
- players.Add(m.GetInt(0), m.GetString(1));
- }
- }
- break;
- #endregion
- #region Left
- case "left":
- {
- if (players.ContainsKey(m.GetInt(0)))
- {
- players.Remove(m.GetInt(0));
- }
- }
- break;
- #endregion
- }
- }));
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement