Example #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);
        }
Example #2
0
        public virtual bool SendStartServer(UInt64 nSessionID, string strServerName)
        {
            if (nSessionID == 0 || strServerName.Length == 0)
            {
                return(false);
            }

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

                if (m_refNetClient.Post(commandSend) == false)
                {
                    return(false);
                }
            }
            catch { return(false); }
            return(true);
        }
Example #3
0
        public virtual bool SendRequestServerInfo(UInt64 nSessionID, string[] arrServerNames)
        {
            if (nSessionID == 0 || arrServerNames.Length == 0)
            {
                return(false);
            }

            try
            {
                NetCommand commandSend = new NetCommand(nSessionID, CMD.GET_SERVERINFO_REQ);
                if (commandSend.WriteByte((byte)arrServerNames.Length) == false)
                {
                    return(false);
                }
                for (int i = 0; i < arrServerNames.Length; ++i)
                {
                    if (commandSend.WriteString(arrServerNames[i]) == false)
                    {
                        return(false);
                    }
                }
                if (commandSend.MakingComplete() == false)
                {
                    return(false);
                }

                if (m_refNetClient.Post(commandSend) == false)
                {
                    return(false);
                }
            }
            catch { return(false); }
            return(true);
        }
Example #4
0
        public bool SendSetverMonitoringLog(UInt64 nSessionID, string strDateTime, string strServerName, int nWorldID, int nServerID, string strLogString)
        {
            NetCommand commandSend = new NetCommand(nSessionID, CMD.MONITORING_LOG);

            if (commandSend.WriteString(strDateTime) == false)
            {
                return(false);
            }
            if (commandSend.WriteString(strServerName) == false)
            {
                return(false);
            }
            if (commandSend.WriteInt32(nWorldID) == false)
            {
                return(false);
            }
            if (commandSend.WriteInt32(nServerID) == false)
            {
                return(false);
            }
            if (commandSend.WriteString(strLogString) == false)
            {
                return(false);
            }

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

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

            return(true);
        }
Example #5
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);
        }
Example #6
0
        public bool SendGetServerListRes(UInt64 nSessionID, ref TRANS_SERVERLISTNODE[] arrServerListNodes)
        {
            NetCommand commandSend = new NetCommand(nSessionID, CMD.GET_SERVERLIST_RES);

            if (commandSend.WriteByte((byte)arrServerListNodes.Length) == false)
            {
                return(false);
            }
            for (int i = 0; i < arrServerListNodes.Length; ++i)
            {
                if (commandSend.WriteString(arrServerListNodes[i].strServerName) == false)
                {
                    return(false);
                }
                if (commandSend.WriteByte((byte)arrServerListNodes[i].nServerType) == false)
                {
                    return(false);
                }
                if (commandSend.WriteInt32(arrServerListNodes[i].nWorldID) == false)
                {
                    return(false);
                }
                if (commandSend.WriteInt32(arrServerListNodes[i].nServerID) == false)
                {
                    return(false);
                }
            }

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

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

            return(true);
        }