예제 #1
0
        public void sendAdminGameScript(string command)
        {
            Packet p = new Packet(getSocket(), PacketType.ADMIN_PACKET_ADMIN_GAMESCRIPT);


            p.WriteString(command); // JSON encode
            NetworkOutputThread.append(p);
        }
예제 #2
0
        public void sendAdminJoin()
        {
            Packet p = new Packet(getSocket(), enums.PacketType.ADMIN_PACKET_ADMIN_JOIN);

            p.WriteString(adminPassword);
            p.WriteString(botName);
            p.WriteString(botVersion);

            NetworkOutputThread.append(p);
        }
예제 #3
0
        public void sendAdminPoll(AdminUpdateType type, long data = 0)
        {
            if (getProtocol().isSupported(type, AdminUpdateFrequency.ADMIN_FREQUENCY_POLL) == false)
            {
                throw new ArgumentException("The server does not support polling for " + type);
            }

            Packet p = new Packet(getSocket(), PacketType.ADMIN_PACKET_ADMIN_POLL);

            p.writeUint8((short)type);
            p.writeUint32(data);

            NetworkOutputThread.append(p);
        }
예제 #4
0
        public void sendAdminUpdateFrequency(AdminUpdateType type, AdminUpdateFrequency freq)
        {
            if (getProtocol().isSupported(type, freq) == false)
            {
                throw new ArgumentException("The server does not support " + freq + " for " + type);
            }

            Packet p = new Packet(getSocket(), PacketType.ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY);

            p.writeUint16((int)type);
            p.writeUint16((int)freq);

            NetworkOutputThread.append(p);
        }
예제 #5
0
        public void sendAdminChat(NetworkAction action, DestType type, long dest, String msg, long data)
        {
            Packet p = new Packet(getSocket(), enums.PacketType.ADMIN_PACKET_ADMIN_CHAT);

            p.writeUint8((short)action);
            p.writeUint8((short)type);
            p.writeUint32(dest);

            msg = (msg.Length > 900) ? msg.Substring(0, 900) : msg;

            p.WriteString(msg);

            p.writeUint64(data);
            NetworkOutputThread.append(p);
        }