Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using PlayerIOClient;
- namespace ExampleProgram
- {
- class Program
- {
- public static Connection conn;
- public static Client client;
- public static List<string> names = new List<string>();
- public static Random ran = new Random();
- static void Main(string[] args)
- {
- client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "bill@bill.com", "bill", null);
- conn = client.Multiplayer.JoinRoom("PW5OjmRHR3bUI", null);
- conn.OnMessage += OnMessage;
- conn.Send("init");
- Console.Read();
- }
- static void OnMessage(object sender, Message m)
- {
- if (m.Type == "init") conn.Send("init2");
- if (m.Type == "add")
- names.Add(m.GetString(1));
- if (m.Type == "say")
- {
- if (m.GetString(1) == ".test")
- {
- conn.Send("say", "I love you, " + names[ran.Next(names.Count)]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement