Ejemplo n.º 1
0
        public virtual bool SendToggleReviveServer(UInt64 nSessionID, string strServerName, bool bRevive)
        {
            if (nSessionID == 0 || strServerName.Length == 0)
            {
                return(false);
            }

            try
            {
                NetCommand commandSend = new NetCommand(nSessionID, CMD.SET_REVIVABLE_ATT_REQ);
                if (commandSend.WriteString(strServerName) == false)
                {
                    return(false);
                }
                if (commandSend.WriteBoolean(bRevive) == false)
                {
                    return(false);
                }
                if (commandSend.MakingComplete() == false)
                {
                    return(false);
                }

                if (m_refNetClient.Post(commandSend) == false)
                {
                    return(false);
                }
            }
            catch { return(false); }
            return(true);
        }
Ejemplo n.º 2
0
        private void PostConnected(bool bIsSuccess)
        {
            NetCommand command = new NetCommand(0, LocalCMD.CONNECTED);

            command.WriteUInt64(m_nSessionID);
            command.WriteBoolean(bIsSuccess);
            command.MakingComplete();
            m_refCommandQueue.PushCommand(command);
        }
Ejemplo n.º 3
0
        public bool SendGetServerInfoRes(UInt64 nSessionID, ref TRANS_SERVERINFONODE[] arrServerInfo)
        {
            NetCommand commandSend = new NetCommand(nSessionID, CMD.GET_SERVERINFO_RES);

            if (commandSend.WriteByte((byte)arrServerInfo.Length) == false)
            {
                return(false);
            }
            for (int i = 0; i < arrServerInfo.Length; ++i)
            {
                if (commandSend.WriteString(arrServerInfo[i].strServerName) == false)
                {
                    return(false);
                }
                if (commandSend.WriteByte((byte)arrServerInfo[i].nProcessState) == false)
                {
                    return(false);
                }
                if (commandSend.WriteByte((byte)arrServerInfo[i].nServableState) == false)
                {
                    return(false);
                }
                if (commandSend.WriteBoolean(arrServerInfo[i].bRevivable) == false)
                {
                    return(false);
                }
                if (commandSend.WriteInt32(arrServerInfo[i].nCurServerPlayerCount) == false)
                {
                    return(false);
                }
            }

            if (commandSend.MakingComplete() == false)
            {
                return(false);
            }

            if (m_refNetServer.Send(commandSend) == false)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        public bool SendCheckCommandVersionRes(UInt64 nSessionID, bool bSuccess)
        {
            NetCommand commandSend = new NetCommand(nSessionID, CMD.CHECK_CMD_VERSION_RES);

            if (commandSend.WriteBoolean(bSuccess) == false)
            {
                return(false);
            }

            if (commandSend.MakingComplete() == false)
            {
                return(false);
            }

            if (m_refNetServer.Send(commandSend) == false)
            {
                return(false);
            }

            return(true);
        }