Exemple #1
0
        public void RemovePlayer(ConnectedPlayer p, uint?reason)
        {
            uint r;

            if (reason.HasValue)
            {
                r = reason.Value;
            }
            else
            {
                r = (uint)PLAYERLEAVEREASON.DISCONNECT;
            }
            var sid = GetSlotId(p);

            Console.WriteLine("User left, cleaning slot " + sid);
            if (sid != 255)
            {
                slots[sid].slotStatus     = (byte)SlotStatus.OPEN;
                slots[sid].pid            = 0;
                slots[sid].downloadStatus = 255;
                UpdateSlots();
            }

            x07PLAYERLEAVE leavepkt = new x07PLAYERLEAVE();

            leavepkt.pid    = p.pid;
            leavepkt.reason = r;
            SendAll(leavepkt);
        }
Exemple #2
0
        public static void initTCP()
        {
            packets[0x01] = new x01PINGFROMHOST();
            packets[0x04] = new x04SLOTINFOJOIN();
            packets[0x05] = new x05REJECTJOIN();
            packets[0x06] = new x06PLAYERINFO();
            packets[0x07] = new x07PLAYERLEAVE();
            packets[0x08] = new x08OTHERGAMELOADED();
            packets[0x09] = new x09SLOTINFO();
            packets[0x0A] = new x0aCOUNTDOWNSTART();
            packets[0x0B] = new x0bCOUNTDOWNEND();
            packets[0x0c] = new x0cACTIONBROADCAST();
            packets[0x0F] = new x0fCHATFROMHOST();

            packets[0x1E] = new x1eJOINREQUEST();

            packets[0x21] = new x21PLAYERLEAVEREQ();
            packets[0x23] = new x23OWNGAMELOADED();
            packets[0x26] = new x26CLIENTACTION();
            packets[0x27] = new x27CLIENTKEEPALIVE();
            packets[0x28] = new x28CHATTOHOST();
            packets[0x3d] = new x3dMAPCHECK();

            packets[0x42] = new x42MAPSIZEVERIFY();
            packets[0x46] = new x46PONGTOHOST();
            packets[0x48] = new x48EXTRAACTIONBROADCAST();
        }
Exemple #3
0
        public void RemoveFakeHost()
        {
            if (fakeHostPID == 255)
            {
                return;
            }

            x07PLAYERLEAVE fhlp = new x07PLAYERLEAVE();

            fhlp.pid    = fakeHostPID;
            fhlp.reason = (int)PLAYERLEAVEREASON.LOST;
            fakeHostPID = 255;
            SendAll(fhlp);
        }