private bool getServerList(string data, ref serverUser server, ref Socket socket) { try { /* AppConfig */ AppConfigClass AppConfig = new AppConfigClass(); string user = AppConfig.GetConfig(ref data, "_"); //执行完毕后data为电脑名称 if (user == "") { return(false); } server.user = user; serverComputer b = new serverComputer() { name = data, socket = socket }; server.server.Add(b); return(true); } catch (Exception error) { new MessageClass().writeLog("Server::getServerList Error:" + error.Message); return(false); } }
private void addServerUserList(serverUser server) { try { if (allServerListInt == -1) { return; } serverComputer b = server.server[0]; allServerList[allServerListInt].server.Add(b); allServerListInt = -1; new MessageClass().writeLine(String.Format("Server user:{0} name:{1} Join in", server.user, server.server[0].name)); } catch (Exception error) { new MessageClass().writeLog("Server::addServerUserList Error:" + error.Message); } }