public virtual void Shutdown() { if (!IsActive()) { return; } State = EServerState.Dead; foreach (var client in Clients) { if (client.IsConnected()) { client.Disconnect("Server shutting down"); } else { client.Clear(); } Clients.Remove(client); } Thread.Sleep(100); Clear(); }
Sprite GetSpriteByState(EServerState state) { CanvasInfo info = mUIObject.GetComponent <CanvasInfo>(); if (info == null) { GameDebug.LogError(string.Format("UIServerListWindow.GetSpriteByState {0} CanvasInfo is null", mWndName)); return(null); } Sprite sprite = null; if (state == EServerState.Smooth) { sprite = info.LoadSprite("MainWindow_New@Common@ServerQuality"); } else if (state == EServerState.Full) { sprite = info.LoadSprite("MainWindow_New@Common@ServerQuality_2"); } else { sprite = info.LoadSprite("MainWindow_New@Common@ServerQuality_3"); } return(sprite); }
private void Transition(EServerStateTransition transition) { if (this.m_stateTransition == transition) { return; } else { if ( transition == EServerStateTransition.STARTING && m_state == EServerState.STOPPED) { m_stateTransition = EServerStateTransition.STARTING; this.StartServer(); m_state = EServerState.STARTED; m_stateTransition = EServerStateTransition.NONE; } else if ( transition == EServerStateTransition.STOPPING && m_state == EServerState.STARTED) { m_stateTransition = EServerStateTransition.STOPPING; this.StopServer(); m_state = EServerState.STOPPED; m_stateTransition = EServerStateTransition.NONE; } } }
/// <summary> /// 账号登陆日志记录(已经选服登陆请求) /// </summary> /// <param name="serverId">Server identifier.</param> /// <param name="serverType">Server type.</param> public void PostAccountLoginLogS(int serverId, EServerState serverType) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = GlobalConfig.GetInstance().LogURLV + "AccountLoginLogS?account=" + loginInfo.AccName; url += "&server_id=" + serverId; url += "&server_type=" + (int)serverType; url += "&show_marked=" + globalConfig.ServerType; url += "&provider=" + globalConfig.SDKName; url += "&device_mark=" + globalConfig.DeviceMark; url += "&os=" + globalConfig.PlatformName; url += "&os_ver=" + bridge.getOSVersion(); url += "&mobile=" + bridge.getPhoneModel(); url += "&net=" + bridge.getNetType(); url += "&imei=" + bridge.getPhoneIMEI(); url += "&mac=" + bridge.getPhoneMAC(); url += "&imsi=" + bridge.getPhoneIMSI(); url += "&game_mark=" + globalConfig.GameMark; url += "&sub_chn=" + globalConfig.SubChannel; MainGame.HttpRequest.GET(url, null, null); }
public virtual void Clear() { // TODO: Remove & clear stringtables State = EServerState.Dead; TickCount = 0; _serverQueryChallenges.Clear(); }
public void AddServerInfo(int index, string name, EServerState state, string address, int port) { ServerInfo info = new ServerInfo(); info.index = index; info.name = name; info.state = state; info.address = address; info.port = port; serverInfoDic.Add(index, info); }
private void Form1_Load(object sender, EventArgs e) { textBox1.Text = comboBox1.Text; serverState = (EServerState)comboBox1.SelectedIndex; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox1.Text = comboBox1.Text; serverState = (EServerState)comboBox1.SelectedIndex; }
public ServerStateChangedEventHandlerArgs(EServerState serverState) { ServerState = serverState; }