/// <summary> /// 请求所有游戏服务器IP列表 /// </summary> /// <returns></returns> public Message packCreateServerInfoResp() { int result = -1; int operateUserID = 0; int gameID = 0; int gameDBID = 0; string gameIP = null; string gameCity = null; int gameFlag = 0; GMLogAPI logAPI = new GMLogAPI(); try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, message.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.ServerInfo_GameID, 4, message.m_packet.m_Body.getTLVByTag(TagName.ServerInfo_GameID).m_bValueBuffer); gameID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.ServerInfo_GameDBID, 4, message.m_packet.m_Body.getTLVByTag(TagName.ServerInfo_GameDBID).m_bValueBuffer); gameDBID = (int)strut.toInteger(); gameIP = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.ServerInfo_IP).m_bValueBuffer); gameCity = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.ServerInfo_City).m_bValueBuffer); userName = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.UserName).m_bValueBuffer); PassWord = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.PassWord).m_bValueBuffer); strut = new TLV_Structure(TagName.ServerInfo_GameFlag, 4, message.m_packet.m_Body.getTLVByTag(TagName.ServerInfo_GameFlag).m_bValueBuffer); gameFlag = (int)strut.toInteger(); result = CommonInfo.LinkServerIP_Create(operateUserID, gameIP, UserName, PassWord, gameCity, gameID, gameDBID, gameFlag); if (result == 1) { logAPI.writeTitle(LanguageAPI.API_Add + LanguageAPI.API_CommonAPI_NewServer, LanguageAPI.API_Add + LanguageAPI.API_CommonAPI_NewServer + LanguageAPI.API_Success + "!"); logAPI.writeContent(LanguageAPI.API_CommonAPI_GameID, LanguageAPI.API_CommonAPI_ServerIP, LanguageAPI.API_CommonAPI_GameCity); logAPI.writeContent(Convert.ToString(gameID), gameIP, gameCity); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.COMMON, ServiceKey.LINK_SERVERIP_CREATE_RESP)); } else { logAPI.writeTitle(LanguageAPI.API_Add + LanguageAPI.API_CommonAPI_NewServer, LanguageAPI.API_Add + LanguageAPI.API_CommonAPI_NewServer + LanguageAPI.API_Failure + "!"); logAPI.writeContent(LanguageAPI.API_CommonAPI_GameID, LanguageAPI.API_CommonAPI_ServerIP, LanguageAPI.API_CommonAPI_GameCity); logAPI.writeContent(Convert.ToString(gameID), gameIP, gameCity); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.COMMON, ServiceKey.LINK_SERVERIP_CREATE_RESP)); } } catch (System.Exception ex) { Console.WriteLine(ex.Message); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.COMMON, ServiceKey.LINK_SERVERIP_CREATE_RESP)); } }