Skip to content

Instantly share code, notes, and snippets.

@KaanGaming
Last active March 9, 2019 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaanGaming/02f4f4f9bda56dc016e074a2cd2805ea to your computer and use it in GitHub Desktop.
Save KaanGaming/02f4f4f9bda56dc016e074a2cd2805ea to your computer and use it in GitHub Desktop.
PlayerIO Everybody Edits testing
using System;
using PlayerIOClient;
namespace Gist
{
class Program
{
static Client client;
static Connection con;
static void Main(string[] args)
{
Console.WriteLine("Connecting...");
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "EMAIL", "PASSWORD", null);
object version = client.BigDB.Load("config", "config")["version"];
con = client.Multiplayer.CreateJoinRoom("WORLDID", "public", true, new Dictionary<string, string>(), new Dictionary<string, string>());
con.Send("init");
con.OnMessage += new MessageReceivedEventHandler(handlemsg);
}
private void handlemsg(object sender, Message m)
{
if (m.Type == "say")
{
if (m.GetString(1) == "!ping")
{
con.Send("pm", m.GetInt(0), "pong");
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment