示例#1
0
        public static void GetMapInfo(this IrinaBotService client, int gameId)
        {
            var buffer = new BufferStream(7, 1);

            buffer.Write((byte)ContextType.DefaultContext);
            buffer.Write((byte)DefaultContext.GetMapInfo);
            buffer.Write(gameId);

            client.Send(buffer);
        }
示例#2
0
        public static void SendMessage(this IrinaBotService client, string toUser, string from, string text)
        {
            var buffer = new BufferStream(2 + toUser.ToCharArray().Length * 2 + from.ToCharArray().Length * 2 + text.ToCharArray().Length * 2, 1);

            buffer.Write((byte)ContextType.DefaultContext);
            buffer.Write((byte)DefaultContext.SendMessage);
            buffer.Write(toUser);
            buffer.Write(from);
            buffer.Write(text);

            client.Send(buffer);
        }
示例#3
0
        public static void CreateGame(this IrinaBotService client, byte isPrivate, byte patch, string mapName, string gameName, string owner)
        {
            var buffer = new BufferStream(1024, 1);

            buffer.Write((byte)ContextType.DefaultContext);
            buffer.Write((byte)DefaultContext.CreateGame);
            buffer.Write(isPrivate); //isPrivate
            buffer.Write(patch);     //default "1" but need to write as sbyte
            buffer.Write((byte)0);   // ???
            buffer.Write(mapName);
            buffer.Write(gameName);
            buffer.Write(owner); //Forevka

            client.Send(buffer);
        }