Exemplo n.º 1
0
        public bool request_move_to_server(ZNet.RemoteID remote, ZNet.CPackOption pkOption, int server_type)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.request_move_to_server;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, server_type);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 2
0
        public bool reponse_message(ZNet.RemoteID remote, ZNet.CPackOption pkOption, string msg)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.reponse_message;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, msg);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 3
0
        public bool GroupTestCommand(ZNet.RemoteID remote, ZNet.CPackOption pkOption, string cmd)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.GroupTestCommand;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, cmd);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 4
0
        public bool reponse_move_to_server(ZNet.RemoteID remote, ZNet.CPackOption pkOption, bool result, ZNet.NetAddress addr)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.reponse_move_to_server;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, result);
            RemoteClass.Marshaler.Write(Msg, addr);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 5
0
        public bool room_lobby_outroom(ZNet.RemoteID remote, ZNet.CPackOption pkOption, Guid roomID, Guid userID)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.room_lobby_outroom;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, roomID);
            RemoteClass.Marshaler.Write(Msg, userID);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 6
0
        public bool request_Login(ZNet.RemoteID remote, ZNet.CPackOption pkOption, string name, string pass)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.request_Login;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, name);
            RemoteClass.Marshaler.Write(Msg, pass);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 7
0
        public override bool ProcessMsg(ZNet.CRecvedMsg rm)
        {
            ZNet.RemoteID remote = rm.remote;
            if (remote == ZNet.RemoteID.Remote_None)
            {
                //err
            }

            ZNet.CPackOption pkOption = rm.pkop;
            ZNet.CMessage    __msg    = rm.msg;
            ZNet.PacketType  PkID     = rm.pkID;
            if (PkID < ZNet.PacketType.PacketType_User)
            {
                return(true);
            }

            switch (PkID)
            {
            case Common.GroupTestCommand:
            {
                string cmd; RemoteClass.Marshaler.Read(__msg, out cmd);

                bool bRet = GroupTestCommand(remote, pkOption, cmd);
                if (bRet == false)
                {
                    NeedImplement("GroupTestCommand");
                }
            }
            break;

            case Common.Chat:
            {
                string msg; RemoteClass.Marshaler.Read(__msg, out msg);

                bool bRet = Chat(remote, pkOption, msg);
                if (bRet == false)
                {
                    NeedImplement("Chat");
                }
            }
            break;

            default: goto __fail;
            }

            return(true);

__fail:
            {
                //err
                return(false);
            }
        }
Exemplo n.º 8
0
        public bool reponse_Echo(ZNet.RemoteID remote, ZNet.CPackOption pkOption, RemoteClass.CUserClass testClass, Dictionary <Int32, Int32> dic_test, string msg)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.reponse_Echo;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, testClass);
            RemoteClass.Marshaler.Write(Msg, dic_test);
            RemoteClass.Marshaler.Write(Msg, msg);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 9
0
        public bool room_lobby_makeroom(ZNet.RemoteID remote, ZNet.CPackOption pkOption, Guid roomID, string name, int number, ZNet.RemoteID remote_svr, ZNet.RemoteID remote_lobby, Guid userID)
        {
            ZNet.CMessage   Msg   = new ZNet.CMessage();
            ZNet.PacketType msgID = (ZNet.PacketType)Common.room_lobby_makeroom;

            Msg.WriteStart(msgID, pkOption, 0, true);

            RemoteClass.Marshaler.Write(Msg, roomID);
            RemoteClass.Marshaler.Write(Msg, name);
            RemoteClass.Marshaler.Write(Msg, number);
            RemoteClass.Marshaler.Write(Msg, remote_svr);
            RemoteClass.Marshaler.Write(Msg, remote_lobby);
            RemoteClass.Marshaler.Write(Msg, userID);

            return(PacketSend(remote, pkOption, Msg));
        }
Exemplo n.º 10
0
        public override bool ProcessMsg(ZNet.CRecvedMsg rm)
        {
            ZNet.RemoteID remote = rm.remote;
            if (remote == ZNet.RemoteID.Remote_None)
            {
                //err
            }

            ZNet.CPackOption pkOption = rm.pkop;
            ZNet.CMessage    __msg    = rm.msg;
            ZNet.PacketType  PkID     = rm.pkID;
            if (PkID < ZNet.PacketType.PacketType_User)
            {
                return(true);
            }

            switch (PkID)
            {
            case Common.request_message:
            {
                RemoteClass.CUserClass    testClass; RemoteClass.Marshaler.Read(__msg, out testClass);
                Dictionary <Int32, Int32> dic_test; RemoteClass.Marshaler.Read(__msg, out dic_test);
                string msg; RemoteClass.Marshaler.Read(__msg, out msg);

                bool bRet = request_message(remote, pkOption, testClass, dic_test, msg);
                if (bRet == false)
                {
                    NeedImplement("request_message");
                }
            }
            break;

            case Common.reponse_message:
            {
                RemoteClass.CUserClass    testClass; RemoteClass.Marshaler.Read(__msg, out testClass);
                Dictionary <Int32, Int32> dic_test; RemoteClass.Marshaler.Read(__msg, out dic_test);
                string msg; RemoteClass.Marshaler.Read(__msg, out msg);

                bool bRet = reponse_message(remote, pkOption, testClass, dic_test, msg);
                if (bRet == false)
                {
                    NeedImplement("reponse_message");
                }
            }
            break;

            case Common.request_move_to_server:
            {
                int server_type; RemoteClass.Marshaler.Read(__msg, out server_type);

                bool bRet = request_move_to_server(remote, pkOption, server_type);
                if (bRet == false)
                {
                    NeedImplement("request_move_to_server");
                }
            }
            break;

            case Common.reponse_move_to_server:
            {
                bool            result; RemoteClass.Marshaler.Read(__msg, out result);
                ZNet.NetAddress addr; RemoteClass.Marshaler.Read(__msg, out addr);

                bool bRet = reponse_move_to_server(remote, pkOption, result, addr);
                if (bRet == false)
                {
                    NeedImplement("reponse_move_to_server");
                }
            }
            break;

            default: goto __fail;
            }

            return(true);

__fail:
            {
                //err
                return(false);
            }
        }
Exemplo n.º 11
0
        public override bool ProcessMsg(ZNet.CRecvedMsg rm)
        {
            ZNet.RemoteID remote = rm.remote;
            if (remote == ZNet.RemoteID.Remote_None)
            {
                //err
            }

            ZNet.CPackOption pkOption = rm.pkop;
            ZNet.CMessage    __msg    = rm.msg;
            ZNet.PacketType  PkID     = rm.pkID;
            if (PkID < ZNet.PacketType.PacketType_User)
            {
                return(true);
            }

            switch (PkID)
            {
            case Common.request_lobby_list:
            {
                bool bRet = request_lobby_list(remote, pkOption);
                if (bRet == false)
                {
                    NeedImplement("request_lobby_list");
                }
            }
            break;

            case Common.notify_lobby_list:
            {
                Dictionary <ZNet.RemoteID, ZNet.MasterInfo> lobby_list; RemoteClass.Marshaler.Read(__msg, out lobby_list);

                bool bRet = notify_lobby_list(remote, pkOption, lobby_list);
                if (bRet == false)
                {
                    NeedImplement("notify_lobby_list");
                }
            }
            break;

            case Common.Chat:
            {
                string msg; RemoteClass.Marshaler.Read(__msg, out msg);

                bool bRet = Chat(remote, pkOption, msg);
                if (bRet == false)
                {
                    NeedImplement("Chat");
                }
            }
            break;

            case Common.request_go_lobby:
            {
                string lobbyname; RemoteClass.Marshaler.Read(__msg, out lobbyname);

                bool bRet = request_go_lobby(remote, pkOption, lobbyname);
                if (bRet == false)
                {
                    NeedImplement("request_go_lobby");
                }
            }
            break;

            case Common.request_make_room:
            {
                string name; RemoteClass.Marshaler.Read(__msg, out name);

                bool bRet = request_make_room(remote, pkOption, name);
                if (bRet == false)
                {
                    NeedImplement("request_make_room");
                }
            }
            break;

            case Common.request_join_room:
            {
                Guid roomID; RemoteClass.Marshaler.Read(__msg, out roomID);

                bool bRet = request_join_room(remote, pkOption, roomID);
                if (bRet == false)
                {
                    NeedImplement("request_join_room");
                }
            }
            break;

            case Common.request_out_room:
            {
                bool bRet = request_out_room(remote, pkOption);
                if (bRet == false)
                {
                    NeedImplement("request_out_room");
                }
            }
            break;

            case Common.room_lobby_makeroom:
            {
                Guid          roomID; RemoteClass.Marshaler.Read(__msg, out roomID);
                string        name; RemoteClass.Marshaler.Read(__msg, out name);
                int           number; RemoteClass.Marshaler.Read(__msg, out number);
                ZNet.RemoteID remote_svr; RemoteClass.Marshaler.Read(__msg, out remote_svr);
                ZNet.RemoteID remote_lobby; RemoteClass.Marshaler.Read(__msg, out remote_lobby);
                Guid          userID; RemoteClass.Marshaler.Read(__msg, out userID);

                bool bRet = room_lobby_makeroom(remote, pkOption, roomID, name, number, remote_svr, remote_lobby, userID);
                if (bRet == false)
                {
                    NeedImplement("room_lobby_makeroom");
                }
            }
            break;

            case Common.room_lobby_joinroom:
            {
                Guid roomID; RemoteClass.Marshaler.Read(__msg, out roomID);
                Guid userID; RemoteClass.Marshaler.Read(__msg, out userID);

                bool bRet = room_lobby_joinroom(remote, pkOption, roomID, userID);
                if (bRet == false)
                {
                    NeedImplement("room_lobby_joinroom");
                }
            }
            break;

            case Common.room_lobby_outroom:
            {
                Guid roomID; RemoteClass.Marshaler.Read(__msg, out roomID);
                Guid userID; RemoteClass.Marshaler.Read(__msg, out userID);

                bool bRet = room_lobby_outroom(remote, pkOption, roomID, userID);
                if (bRet == false)
                {
                    NeedImplement("room_lobby_outroom");
                }
            }
            break;

            default: goto __fail;
            }

            return(true);

__fail:
            {
                //err
                return(false);
            }
        }
Exemplo n.º 12
0
        public override bool ProcessMsg(ZNet.CRecvedMsg rm)
        {
            ZNet.RemoteID remote = rm.remote;
            if (remote == ZNet.RemoteID.Remote_None)
            {
                //err
            }

            ZNet.CPackOption pkOption = rm.pkop;
            ZNet.CMessage    __msg    = rm.msg;
            ZNet.PacketType  PkID     = rm.pkID;
            if (PkID < ZNet.PacketType.PacketType_User)
            {
                return(true);
            }

            switch (PkID)
            {
            case Common.request_Login:
            {
                string name; RemoteClass.Marshaler.Read(__msg, out name);
                string pass; RemoteClass.Marshaler.Read(__msg, out pass);

                bool bRet = request_Login(remote, pkOption, name, pass);
                if (bRet == false)
                {
                    NeedImplement("request_Login");
                }
            }
            break;

            case Common.reponse_Login:
            {
                bool bResult; RemoteClass.Marshaler.Read(__msg, out bResult);

                bool bRet = reponse_Login(remote, pkOption, bResult);
                if (bRet == false)
                {
                    NeedImplement("reponse_Login");
                }
            }
            break;

            case Common.server_move:
            {
                int server_type; RemoteClass.Marshaler.Read(__msg, out server_type);

                bool bRet = server_move(remote, pkOption, server_type);
                if (bRet == false)
                {
                    NeedImplement("server_move");
                }
            }
            break;

            case Common.Chat:
            {
                string txt; RemoteClass.Marshaler.Read(__msg, out txt);

                bool bRet = Chat(remote, pkOption, txt);
                if (bRet == false)
                {
                    NeedImplement("Chat");
                }
            }
            break;

            default: goto __fail;
            }

            return(true);

__fail:
            {
                //err
                return(false);
            }
        }