Beispiel #1
0
        public void NotifyInDisConnectClient(ServerPacketData requestData)
        {
            var sessionID = requestData.SessionID;
            var user      = UserMgr.GetUser(sessionID);

            if (user != null)
            {
                var roomNum = user.RoomNumber;

                if (roomNum != PacketDef.INVALID_ROOM_NUMBER)
                {
                    var packet = new PKTInternalNtfRoomLeave()
                    {
                        RoomNumber = roomNum,
                        UserID     = user.ID(),
                    };

                    var packetBodyData = MessagePackSerializer.Serialize(packet);
                    var internalPacket = new ServerPacketData();
                    internalPacket.Assign(sessionID, (Int16)PACKETID.NTF_IN_ROOM_LEAVE, packetBodyData);

                    ServerNetwork.Distribute(internalPacket);
                }

                UserMgr.RemoveUser(sessionID);
            }

            MainServer.MainLogger.Debug($"Current Connected Session Count: {ServerNetwork.SessionCount}");
        }
        public void DistributeDBJobResult(DBResultQueue resultData)
        {
            var sessionIndex = resultData.SessionIndex;

            var requestPacket = new ServerPacketData();
            requestPacket.Assign(resultData);

            DistributeCommon(false, requestPacket);            
        }
Beispiel #3
0
        ServerPacketData MakeInternalRoomEnterPacket(int roomNumber, string userID, string sessionID, int sessionIndex)
        {
            var packet = new PKTInternalReqRoomEnter()
            {
                RoomNumber = roomNumber,
                UserID     = userID,
            };

            var packetBodyData = MessagePackSerializer.Serialize(packet);

            var internalPacket = new ServerPacketData();

            internalPacket.Assign(sessionID, sessionIndex, (Int16)PACKETID.REQ_IN_ROOM_ENTER, packetBodyData);
            return(internalPacket);
        }
Beispiel #4
0
        void SendInternalRoomLeavePacket(int roomNumber, string userID)
        {
            // 구현하기
            var packet = new PKTInternalNtfRoomLeave()
            {
                RoomNumber = roomNumber,
                UserID     = userID,
            };

            var packetBodyData = MessagePackSerializer.Serialize(packet);

            var internalPacket = new ServerPacketData();

            internalPacket.Assign("", -1, (Int16)PACKETID.NTF_IN_ROOM_LEAVE, packetBodyData);

            SendInternalRoomProcessor(false, roomNumber, internalPacket);
        }