Beispiel #1
0
        private void btnGmServerCloseServer_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(this, "确定要关闭GM服务器吗?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }

            GmExecuteCmdRequest.Builder builder = GmExecuteCmdRequest.CreateBuilder();
            builder.SetServerType(RemoteServerTypeEnum.ServerTypeGm);
            builder.SetCmdType(GmCmdTypeEnum.GmCmdCloseServer);
            WebSocketManager.SendMessage(GmRpcNameEnum.GmRpcExecuteCmd, builder.Build().ToByteArray(), OnExecuteCmdCallback);
        }
Beispiel #2
0
        private void btnBattleServerReloadTableConfig_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(this, "确定要重载所有Battle服务器的表格吗?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }

            GmExecuteCmdRequest.Builder builder = GmExecuteCmdRequest.CreateBuilder();
            builder.SetServerType(RemoteServerTypeEnum.ServerTypeBattle);
            builder.SetCmdType(GmCmdTypeEnum.GmCmdReloadTableConfig);
            WebSocketManager.SendMessage(GmRpcNameEnum.GmRpcExecuteCmd, builder.Build().ToByteArray(), OnExecuteCmdCallback);
        }
Beispiel #3
0
        private void dgvLogicServerInfo_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                if (dgvLogicServerInfo.Columns[e.ColumnIndex].Name == "dgvcLogicServerReloadTableConfig" || dgvLogicServerInfo.Columns[e.ColumnIndex].Name == "dgvcLogicServerCloseServer")
                {
                    string idStr            = dgvLogicServerInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    int    leftBracketIndex = idStr.IndexOf('(');
                    if (leftBracketIndex != -1)
                    {
                        idStr = idStr.Substring(0, leftBracketIndex);
                    }

                    int serverId = int.Parse(idStr);

                    GmExecuteCmdRequest.Builder builder = GmExecuteCmdRequest.CreateBuilder();
                    builder.SetServerType(RemoteServerTypeEnum.ServerTypeLogic);
                    builder.AddServerIds(serverId);

                    if (dgvLogicServerInfo.Columns[e.ColumnIndex].Name == "dgvcLogicServerReloadTableConfig")
                    {
                        string tips = string.Format("确定要重载id为{0}的Logic服务器表格吗?", serverId);
                        if (MessageBox.Show(this, tips, "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
                        {
                            return;
                        }

                        builder.SetCmdType(GmCmdTypeEnum.GmCmdReloadTableConfig);
                    }
                    else if (dgvLogicServerInfo.Columns[e.ColumnIndex].Name == "dgvcLogicServerCloseServer")
                    {
                        string tips = string.Format("确定要关闭id为{0}的Logic服务器吗?", serverId);
                        if (MessageBox.Show(this, tips, "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
                        {
                            return;
                        }

                        builder.SetCmdType(GmCmdTypeEnum.GmCmdCloseServer);
                    }

                    WebSocketManager.SendMessage(GmRpcNameEnum.GmRpcExecuteCmd, builder.Build().ToByteArray(), OnExecuteCmdCallback);
                }
            }
        }
Beispiel #4
0
        private void dgvGatewayInfo_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                if (dgvGatewayInfo.Columns[e.ColumnIndex].Name == "dgvcGatewayCloseServer")
                {
                    string idStr    = dgvGatewayInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    int    serverId = int.Parse(idStr);

                    string tips = string.Format("确定要关闭id为{0}的Gateway服务器吗?", serverId);
                    if (MessageBox.Show(this, tips, "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
                    {
                        return;
                    }

                    GmExecuteCmdRequest.Builder builder = GmExecuteCmdRequest.CreateBuilder();
                    builder.SetServerType(RemoteServerTypeEnum.ServerTypeGateway);
                    builder.AddServerIds(serverId);
                    builder.SetCmdType(GmCmdTypeEnum.GmCmdCloseServer);

                    WebSocketManager.SendMessage(GmRpcNameEnum.GmRpcExecuteCmd, builder.Build().ToByteArray(), OnExecuteCmdCallback);
                }
            }
        }