Beispiel #1
0
        static public void SendFireHandler(NetConnection connection, object data)
        {
            FireData fire = null;

            try
            {
                fire = GSrv.Deserialize <FireData>((byte[])data);
            }
            catch
            {
                return;
            }

            if (!PlayerCaches.AuthDone(connection))
            {
                return;
            }

            if (PlayerCaches.InLobby(connection))
            {
                return;
            }

            int roomid = PlayerCaches.GetRoomID(connection);

            if (Lobby.GetRoomState(roomid) == 0)
            {
                return;
            }

            Lobby.ReplyFire(connection, roomid, fire);
        }
Beispiel #2
0
        static public void PushHandler(NetConnection connection, object data)
        {
            PushData push = null;

            try
            {
                push = GSrv.Deserialize <PushData>((byte[])data);
            }
            catch
            {
                return;
            }

            if (!PlayerCaches.AuthDone(connection))
            {
                return;
            }

            if (PlayerCaches.InLobby(connection))
            {
                return;
            }

            int roomid = PlayerCaches.GetRoomID(connection);

            if (Lobby.GetRoomState(roomid) == 0)
            {
                return;
            }

            Lobby.Push(connection, roomid, push);
        }
Beispiel #3
0
        static public void SetBlockHandler(NetConnection connection, object data)
        {
            BlockData block = null;

            try
            {
                block = GSrv.Deserialize <BlockData>((byte[])data);
            }
            catch
            {
                return;
            }

            if (!PlayerCaches.AuthDone(connection))
            {
                return;
            }

            if (PlayerCaches.InLobby(connection))
            {
                return;
            }

            int roomid = PlayerCaches.GetRoomID(connection);

            if (Lobby.GetRoomState(roomid) == 0)
            {
                return;
            }

            if (!Env.IsInsideWorld(block.x, block.y, block.z))
            {
                return;
            }

            if (Env.IsCorePos(block.x, block.y, block.z))
            {
                return;
            }

            Lobby.ReplySetBlock(roomid, block);
        }
Beispiel #4
0
        static public void DrawHandler(NetConnection connection, object data)
        {
            DrawData draw = GSrv.Deserialize <DrawData>((byte[])data);

            World.Buffer(draw);
        }
Beispiel #5
0
        static public void PushHandler(NetConnection connection, object data)
        {
            PushData push = GSrv.Deserialize <PushData>((byte[])data);

            Players.Push(connection, push);
        }