/// <summary> /// 玩家的G币补发 /// </summary> /// <returns></returns> public Message SDO_GCash_Update() { int result = -1; int operateUserID = 0; string account = null; string serverIP = null; int GCash = 0; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_ServerIP).m_bValueBuffer); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_Account).m_bValueBuffer); TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.SDO_GCash, 4, msg.m_packet.m_Body.getTLVByTag(TagName.SDO_GCash).m_bValueBuffer); GCash = (int)strut.toInteger(); result = ItemLogInfo.SDO_UserMcash_addG(operateUserID, serverIP, account, GCash); if (result == -1) { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + " " + account + lg.SDOAPI_SDOCharacterInfoAPI_NoAccount + "!"); return(Message.COMMON_MES_RESP(lg.SDOAPI_SDOCharacterInfoAPI_NoAccount, Msg_Category.SDO_ADMIN, ServiceKey.SDO_USERGCASH_UPDATE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } else if (result == 1) { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.SDOAPI_SDOItemLogInfoAPI_Account + account + lg.SDOAPI_SDOItemLogInfoAPI_Compensate + GCash + lg.SDOAPI_SDOItemLogInfoAPI_GCash + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.SDO_ADMIN, ServiceKey.SDO_USERGCASH_UPDATE_RESP)); } else { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.SDOAPI_SDOItemLogInfoAPI_Account + account + lg.SDOAPI_SDOItemLogInfoAPI_Compensate + GCash + lg.SDOAPI_SDOItemLogInfoAPI_GCash + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.SDO_ADMIN, ServiceKey.SDO_USERGCASH_UPDATE_RESP)); } } catch (Common.Logic.Exception ex) { return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.SDO_ADMIN, ServiceKey.SDO_USERGCASH_UPDATE_RESP)); } }
/// <summary> /// 道具查询 /// </summary> /// <returns></returns> public Message JW2_ItemInfo_Query(int index, int pageSize) { string serverIP = ""; int type = -1; DataSet ds = null; int userSN = -1; try { //ip地址 serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); //用户SN TLV_Structure strut = new TLV_Structure(TagName.JW2_UserSN, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserSN).m_bValueBuffer); userSN = (int)strut.toInteger(); //查询类型 strut = new TLV_Structure(TagName.JW2_UserSN, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ItemPos).m_bValueBuffer); type = (int)strut.toInteger(); SqlHelper.log.WriteLog(lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_PlayerAccount + userSN + lg.JW2API_ItemInfo); Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_PlayerAccount + userSN + lg.JW2API_ItemInfo); ds = JW2DataInfo.JW2ItemDataInfo.ItemInfo_Query(serverIP, userSN, type); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = Message.JW2_buildTLV(ds, index, pageSize, false, serverIP); return(Message.COMMON_MES_RESP(structList, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ItemInfo_Query_Resp, (int)structList[0].structLen)); } else { return(Message.COMMON_MES_RESP(lg.JW2API_NoPlayerItemInfo, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ItemInfo_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog(lg.JW2API_QueryItemInfo + serverIP + lg.JW2API_PlayerAccount + userSN + "->" + ex.Message); return(Message.COMMON_MES_RESP(lg.JW2API_NoPlayerItemInfo, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ItemInfo_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 停封服务器玩家帐号 /// </summary> /// <returns></returns> public Message SDOMemberClose_Update() { int result = -1; int operateUserID = 0; string serverIP = null; string account = null; string reason = null; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); serverIP = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_ServerIP).m_bValueBuffer); account = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_Account).m_bValueBuffer); reason = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_REASON).m_bValueBuffer); result = MemberInfo.SDO_Banishment_Close(operateUserID, serverIP, account, reason); if (result == -1) { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + " " + account + lg.SDOAPI_SDOCharacterInfoAPI_NoAccount + "!"); return(Message.COMMON_MES_RESP(lg.SDOAPI_SDOCharacterInfoAPI_NoAccount + "!", Msg_Category.SDO_ADMIN, ServiceKey.SDO_ACCOUNT_CLOSE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } else if (result == 1) { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.SDOAPI_SDOItemLogInfoAPI_Account + account + lg.SDOAPI_SDOMemberInfoAPI_AccountLock + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.SDO_ADMIN, ServiceKey.SDO_ACCOUNT_CLOSE_RESP)); } else { Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.SDOAPI_SDO + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.SDOAPI_SDOItemLogInfoAPI_Account + account + lg.SDOAPI_SDOMemberInfoAPI_AccountLock + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.SDO_ADMIN, ServiceKey.SDO_ACCOUNT_CLOSE_RESP)); } } catch (System.Exception e) { return(Message.COMMON_MES_RESP(e.Message, Msg_Category.SDO_ADMIN, ServiceKey.SDO_ACCOUNT_CLOSE_RESP)); } }
/// <summary> /// 根据得到模块信息类 /// </summary> /// <param name="userID">用户ID</param> /// <returns>模块类</returns> public Message GM_getModuleInfo() { GMLogAPI logAPI = new GMLogAPI(); System.Data.DataSet ds = null; try { //将模块信息存入DATASET ds = GMModuleInfo.SelectAll(); //构造一个模块信息类 Query_Structure[] structList = new Query_Structure[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Query_Structure strut = new Query_Structure((uint)ds.Tables[0].Rows[i].ItemArray.Length); strut.AddTagKey(TagName.GameID, TagFormat.TLV_INTEGER, 4, TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, ds.Tables[0].Rows[i].ItemArray[0])); strut.AddTagKey(TagName.Module_ID, TagFormat.TLV_INTEGER, 4, TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, ds.Tables[0].Rows[i].ItemArray[1])); byte[] bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[i].ItemArray[2]); strut.AddTagKey(TagName.GameName, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[i].ItemArray[3]); strut.AddTagKey(TagName.ModuleName, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[i].ItemArray[4]); strut.AddTagKey(TagName.ModuleClass, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[i].ItemArray[5]); strut.AddTagKey(TagName.ModuleContent, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); structList[i] = strut; //打印具体信息 //logAPI.writeData(ds.Tables[0].Rows[i].ItemArray[1].ToString(),ds.Tables[0].Rows[i].ItemArray[2].ToString(),ds.Tables[0].Rows[i].ItemArray[3].ToString(),ds.Tables[0].Rows[i].ItemArray[4].ToString()); } //Console.Write(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP(structList, Msg_Category.USER_MODULE_ADMIN, ServiceKey.USER_MODULE_QUERY_RESP, 6)); } catch (System.Exception) { return(Message.COMMON_MES_RESP(LanguageAPI.API_UserModuleAPI_NoRecord, Msg_Category.USER_MODULE_ADMIN, ServiceKey.USER_MODULE_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 修改角色停封信息 /// </summary> /// <returns></returns> public Message CharacterState_Modify() { int operateUserID = 0; int result = -1; string serverIP = ""; int char_idx = 0; string str_ddate = ""; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.Soccer_ServerIP).m_bValueBuffer); str_ddate = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.Soccer_deleted_date).m_bValueBuffer); strut = new TLV_Structure(TagName.Soccer_charidx, 4, msg.m_packet.m_Body.getTLVByTag(TagName.Soccer_charidx).m_bValueBuffer); char_idx = (int)strut.toInteger(); result = SOCCERCharacterInfo.CharacterState_Modify(operateUserID, serverIP, char_idx, str_ddate); if (result == 0) { SqlHelper.log.WriteLog(lg.API_Display + lg.Soccer_Soccer + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.Soccer_CharacterInfoAPI_Character + char_idx + lg.API_Update + lg.Soccer_CharacterInfoAPI_BanInfo + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.Soccer_Soccer + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.Soccer_CharacterInfoAPI_Character + char_idx + lg.API_Update + lg.Soccer_CharacterInfoAPI_BanInfo + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.SOCCER_ADMIN, ServiceKey.SOCCER_CHARACTERSTATE_MODIFY_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.Soccer_Soccer + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.Soccer_CharacterInfoAPI_Character + char_idx + lg.API_Update + lg.Soccer_CharacterInfoAPI_BanInfo + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.Soccer_Soccer + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.Soccer_CharacterInfoAPI_Character + char_idx + lg.API_Update + lg.Soccer_CharacterInfoAPI_BanInfo + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.SOCCER_ADMIN, ServiceKey.SOCCER_CHARACTERSTATE_MODIFY_RESP)); } } catch (System.Exception ex) { Console.WriteLine(ex.Message); return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.SOCCER_ADMIN, ServiceKey.SOCCER_CHARACTERSTATE_MODIFY_RESP)); } }
/// <summary> /// 遗漏频道重新插入 /// </summary> /// <returns></returns> public Message CR_ErrorChannel_Insert() { string err_channels = null; int userByID = 0; int BoardID = 0; string serverIP = null; string channel = null; try { TLV_Structure tlv = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID = (int)tlv.toInteger(); serverIP = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.CR_ServerIP).m_bValueBuffer); tlv = new TLV_Structure(TagName.CR_BoardID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.CR_BoardID).m_bValueBuffer); BoardID = (int)tlv.toInteger(); channel = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.CR_Channel).m_bValueBuffer); err_channels = CRCallBoardInfo.Channels_ADD(userByID, serverIP, BoardID, channel); string[] channels = err_channels.Split(','); if (channels.Length == 1) { SqlHelper.log.WriteLog(lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.CR_CallBoardAPI_ChannelInfo + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.CR_CallBoardAPI_ChannelInfo + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.CR_ADMIN, ServiceKey.CR_ERRORCHANNEL_QUERY_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_CallBoardAPI_ChannelInfo + err_channels + lg.API_Add + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_CallBoardAPI_ChannelInfo + err_channels + lg.API_Add + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP(err_channels, Msg_Category.CR_ADMIN, ServiceKey.CR_ERRORCHANNEL_QUERY_RESP)); } } catch (System.Exception ex) { SqlHelper.log.WriteLog(lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_CallBoardAPI_ChannelInfo + err_channels + lg.API_Add + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_CallBoardAPI_ChannelInfo + err_channels + lg.API_Add + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.CR_ADMIN, ServiceKey.CR_ERRORCHANNEL_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 给用户添加模块 /// </summary> /// <returns></returns> public Message GM_UserModuleAdmin() { GMLogAPI logAPI = new GMLogAPI(); int result = -1; int userByID = 0; int userID = 0; string moduleList = null; TLV_Structure tlv1 = new TLV_Structure(TagName.User_ID, 3, msg.m_packet.m_Body.getTLVByTag(TagName.User_ID).m_bValueBuffer); userID = (int)tlv1.toInteger(); TLV_Structure tlv2 = new TLV_Structure(TagName.UserByID, 3, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID = (int)tlv2.toInteger(); moduleList = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.ModuleList).m_bValueBuffer); result = GMUserModule.UserModuleAdmin(userID, moduleList); //打印标题 logAPI.writeTitle(LanguageAPI.API_UserModuleAPI_UserAuth, userID + LanguageAPI.API_UserModuleAPI_UserModule); //打印名称 logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_UserInfoAPI_UserID, LanguageAPI.API_ModuleInfoAPI_ModuleList); logAPI.writeData(Convert.ToString(userByID), Convert.ToString(userID), moduleList); Console.Write(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.USER_MODULE_ADMIN, ServiceKey.USER_MODULE_CREATE_RESP)); }
/// <summary> /// 插入一个新的用户与模块关系数据 /// </summary> public void GM_InsertUserModuleInfo() { int userID = 0; int moduleID = 0; try { TLV_Structure tlv1 = new TLV_Structure(TagName.User_ID, 3, msg.m_packet.m_Body.getTLVByTag(TagName.User_ID).m_bValueBuffer); userID = (int)tlv1.toInteger(); TLV_Structure tlv2 = new TLV_Structure(TagName.Module_ID, 3, msg.m_packet.m_Body.getTLVByTag(TagName.Module_ID).m_bValueBuffer); moduleID = (int)tlv2.toInteger(); TLV_Structure tlv = new TLV_Structure(TagName.Limit, 3, msg.m_packet.m_Body.getTLVByTag(TagName.Limit).m_bValueBuffer); DateTime limit = tlv.toDate(); //GMUserInfo.insertRow(userName,passWd,mac,limit); } catch (Common.Logic.Exception ex) { Console.WriteLine(ex.Message); } }
/// <summary> /// 查看该玩家的帐号信息 /// </summary> /// <returns></returns> public Message Audition_Account_Query() { string serverIP = null; string account = null; try { serverIP = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.AU_ServerIP).m_bValueBuffer); account = AUMemberInfo.Audition_Identity9you_Query(serverIP, System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.AU_ACCOUNT).m_bValueBuffer)); SqlHelper.log.WriteLog(lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + serverIP + lg.AU_AUAvatarListAPI_Account + account + lg.AU_AUCharacterInfoAPI_AccountInfo); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + serverIP + lg.AU_AUAvatarListAPI_Account + account + lg.AU_AUCharacterInfoAPI_AccountInfo); System.Data.DataSet ds = AUMemberInfo.Audition_Account_Query(serverIP, account); Query_Structure[] structList = new Query_Structure[1]; if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure strut = new Query_Structure((uint)ds.Tables[0].Rows[0].ItemArray.Length); byte[] bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0])); strut.AddTagKey(TagName.AU_UserSN, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[0].ItemArray[1]); strut.AddTagKey(TagName.AU_UserID, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, ds.Tables[0].Rows[0].ItemArray[2].ToString().Trim()); strut.AddTagKey(TagName.AU_UserNick, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToUInt32(ds.Tables[0].Rows[0].ItemArray[3])); strut.AddTagKey(TagName.AU_SexIndex, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); structList[0] = strut; return(Message.COMMON_MES_RESP(structList, Msg_Category.AU_ADMIN, ServiceKey.AU_ACCOUNT_QUERY_RESP, 4)); } else { return(Message.COMMON_MES_RESP(lg.AU_AUCharacterInfoAPI_NoAccount, Msg_Category.AU_ADMIN, ServiceKey.AU_ACCOUNT_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception e) { return(Message.COMMON_MES_RESP(lg.AU_AUCharacterInfoAPI_NoAccount, Msg_Category.AU_ADMIN, ServiceKey.AU_ACCOUNT_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 删除一个模块信息 /// </summary> public Message GM_DelDepartInfo() { GMLogAPI logAPI = new GMLogAPI(); int result = -1; int deptID = 0; int userByID = 0; try { TLV_Structure strut1 = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID = (int)strut1.toInteger(); TLV_Structure strut2 = new TLV_Structure(TagName.DepartID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.DepartID).m_bValueBuffer); deptID = (int)strut2.toInteger(); result = GMDepartmentInfo.deleteRow(userByID, deptID); if (result == 1) { logAPI.writeTitle(LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo, LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo + LanguageAPI.API_Success + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_DepartmentAPI_DepTitle, LanguageAPI.API_DepartmentAPI_DepDesp); logAPI.writeContent(Convert.ToString(userByID), Convert.ToString(deptID), LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.USER_ADMIN, ServiceKey.DEPARTMENT_DELETE_RESP, TagName.Status, TagFormat.TLV_STRING)); } else { logAPI.writeTitle(LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo, LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo + LanguageAPI.API_Failure + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_DepartmentAPI_DepTitle, LanguageAPI.API_DepartmentAPI_DepDesp); logAPI.writeContent(Convert.ToString(userByID), Convert.ToString(deptID), LanguageAPI.API_Delete + LanguageAPI.API_DepartmentAPI_DepInfo); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.USER_ADMIN, ServiceKey.DEPARTMENT_DELETE_RESP, TagName.Status, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { Console.WriteLine(ex.Message); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.USER_ADMIN, ServiceKey.DEPARTMENT_DELETE_RESP, TagName.Status, TagFormat.TLV_STRING)); } }
/// <summary> /// 玩家等级经验信息查询 /// </summary> /// <returns></returns> public Message AuditionLevelExp_Query() { string serverIP = null; System.Data.DataSet ds = null; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.AU_ServerIP).m_bValueBuffer); SqlHelper.log.WriteLog(lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUCharacterInfoAPI_CharacterLevelInfo); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUCharacterInfoAPI_CharacterLevelInfo); ds = AUCharacterInfo.LevelInfo_Query(serverIP); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = new Query_Structure[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Query_Structure strut = new Query_Structure((uint)ds.Tables[0].Rows[i].ItemArray.Length); Byte[] bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[0])); strut.AddTagKey(TagName.AU_Level, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[1])); strut.AddTagKey(TagName.AU_Exp, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); structList[i] = strut; } return(Message.COMMON_MES_RESP(structList, Msg_Category.AU_ADMIN, ServiceKey.AU_LEVELEXP_QUERY_RESP, 2)); } else { return(Message.COMMON_MES_RESP(lg.AU_AUCharacterInfoAPI_NoCharacterLevelInfo, Msg_Category.AU_ADMIN, ServiceKey.AU_LEVELEXP_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { Console.WriteLine(ex.Message); return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.AU_ADMIN, ServiceKey.AU_LEVELEXP_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
public Message sendEmailPasswdMsg() { int result = 0; int operateUserID = 0; string serverIP = null; string account = null; string email = null; string password = null; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_Account).m_bValueBuffer); email = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SDO_Email).m_bValueBuffer); password = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.PassWord).m_bValueBuffer); result = CharacterInfo.sendEmailPasswd(operateUserID, account, email, password); if (result == 1) { SqlHelper.log.WriteLog("久游用户中心+>玩家" + account + "发送密码成功!"); Console.WriteLine(DateTime.Now + " - 久游用户中心玩家" + account + "发送密码成功!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.SDO_ADMIN, ServiceKey.SDO_PASSWORD_RECOVERY_RESP)); } else { SqlHelper.log.WriteLog("久游用户中心+>玩家" + account + "发送密码失败!"); Console.WriteLine(DateTime.Now + " - 久游用户中心+>玩家" + account + "发送密码失败!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.SDO_ADMIN, ServiceKey.SDO_PASSWORD_RECOVERY_RESP)); } } catch (System.Exception) { SqlHelper.log.WriteLog("久游用户中心+>服务器地址" + CommonInfo.serverIP_Query(serverIP) + "玩家" + account + "发送密码失败!"); Console.WriteLine(DateTime.Now + " - 久游用户中心+>玩家" + account + "发送密码失败!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.SDO_ADMIN, ServiceKey.SDO_PASSWORD_RECOVERY_RESP)); } }
/// <summary> /// 提交GMTOOLS新BUG信息 /// </summary> /// <returns></returns> public Message Bug_Insert() { int userbyID = 0; string bugSubject = null; string bugContext = null; int gameID = 0;; int bugType = 0; //int bugSender =0; //string result = null ; TLV_Structure tlvStrut = new TLV_Structure(TagName.UserByID, 4, message.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userbyID = (int)tlvStrut.toInteger(); bugSubject = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.Bug_Subject).m_bValueBuffer); bugContext = System.Text.Encoding.Default.GetString(message.m_packet.m_Body.getTLVByTag(TagName.Bug_Context).m_bValueBuffer); tlvStrut = new TLV_Structure(TagName.GameID, 4, message.m_packet.m_Body.getTLVByTag(TagName.GameID).m_bValueBuffer); gameID = (int)tlvStrut.toInteger(); tlvStrut = new TLV_Structure(TagName.Bug_Type, 4, message.m_packet.m_Body.getTLVByTag(TagName.Bug_Type).m_bValueBuffer); bugType = (int)tlvStrut.toInteger(); //tlvStrut = new TLV_Structure(TagName.Bug_Sender, 4, message.m_packet.m_Body.getTLVByTag(TagName.Bug_Sender).m_bValueBuffer); //bugSender = (int)tlvStrut.toInteger(); //tlvStrut = new TLV_Structure(TagName.Bug_Date, 4, message.m_packet.m_Body.getTLVByTag(TagName.Bug_Date).m_bValueBuffer); //bugDate = tlvStrut.toDate(); int status = CommonInfo.BugList_Insert(userbyID, bugSubject, bugContext, gameID, bugType); if (status == 1) { SqlHelper.log.WriteLog(LanguageAPI.ServerSocket_ServerSocket_GMTools_Title + " bug " + bugSubject + LanguageAPI.API_Submit + LanguageAPI.API_Success); Console.WriteLine(DateTime.Now + " - gmtools bug " + bugSubject + LanguageAPI.API_Submit + LanguageAPI.API_Success); return(Message.COMMON_MES_RESP(LanguageAPI.ServerSocket_ServerSocket_GMTools_Title + " bug " + LanguageAPI.API_Submit + LanguageAPI.API_Success, Msg_Category.COMMON, ServiceKey.GMTOOLS_BUGLIST_UPDATE_RESP)); } else { SqlHelper.log.WriteLog(LanguageAPI.ServerSocket_ServerSocket_GMTools_Title + " bug " + bugSubject + LanguageAPI.API_Submit + LanguageAPI.API_Failure); Console.WriteLine(DateTime.Now + " - gmtools bug " + bugSubject + LanguageAPI.API_Submit + LanguageAPI.API_Failure); return(Message.COMMON_MES_RESP(LanguageAPI.ServerSocket_ServerSocket_GMTools_Title + " bug " + LanguageAPI.API_Submit + LanguageAPI.API_Failure, Msg_Category.COMMON, ServiceKey.GMTOOLS_BUGLIST_UPDATE_RESP)); } }
/// <summary> /// 删除玩家技能 /// </summary> /// <returns></returns> public Message RayCity_PlayerSkill_Del() { int operateUserID = 0; string serverIP = null; string account = null; int characterID = 0; int skillID = 0; int result = -1; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_ServerIP).m_bValueBuffer); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_NyUserID).m_bValueBuffer); strut = new TLV_Structure(TagName.RayCity_SkillID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_SkillID).m_bValueBuffer); skillID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.RayCity_CharacterID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_CharacterID).m_bValueBuffer); characterID = (int)strut.toInteger(); SqlHelper.log.WriteLog(lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Delete + lg.RayCityAPI_Account + characterID + lg.RayCityAPI_SkillInfo); Console.WriteLine(DateTime.Now + lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Delete + lg.RayCityAPI_Account + characterID + lg.RayCityAPI_SkillInfo); result = ItemShopInfo.PlayerSkill_Del(operateUserID, serverIP, account, characterID, skillID); if (result == 1) { return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_PlayerSkill_Delete_Resp, TagName.Status, TagFormat.TLV_STRING)); } else { return(Message.COMMON_MES_RESP("SUCCESS", Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_PlayerSkill_Delete_Resp, TagName.Status, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog("伺服器IP" + serverIP + ex.Message); return(Message.COMMON_MES_RESP(lg.API_Error, Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_PlayerSkill_Delete_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 删除玩家身上道具 /// </summary> /// <returns></returns> public Message ItemShop_Delete() { int operateUserID = 0; int userIndexID = 0; string serverIP = null; int pos = 0; int flag = 0; int result = -1; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_ServerIP).m_bValueBuffer); TLV_Structure strut = new TLV_Structure(TagName.o2jam_USER_INDEX_ID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_USER_INDEX_ID).m_bValueBuffer); userIndexID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_POSITION, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_POSITION).m_bValueBuffer); pos = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_TypeFlag, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_TypeFlag).m_bValueBuffer); flag = (int)strut.toInteger(); result = ItemShopInfo.itemShop_Delete(operateUserID, serverIP, userIndexID, pos, flag); if (result == 1) { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.API_Delete + lg.O2JAM_ItemShopInfoAPI_PersonalItem + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.API_Delete + lg.O2JAM_ItemShopInfoAPI_PersonalItem + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.API_Delete + lg.O2JAM_ItemShopInfoAPI_PersonalItem + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.API_Delete + lg.O2JAM_ItemShopInfoAPI_PersonalItem + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP)); } } catch (Common.Logic.Exception ex) { return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP)); } }
/// <summary> /// 查询最后一次临时密码 /// </summary> /// <returns></returns> public Message JW2_SearchPassWord_Query() { string serverIP = ""; //int uid = 0; DataSet ds = null; string username = ""; string serverName = ""; int usersn = 0; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); serverName = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerName).m_bValueBuffer); username = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserID).m_bValueBuffer); //用户 TLV_Structure strut = new TLV_Structure(TagName.f_idx, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserSN).m_bValueBuffer); usersn = (int)strut.toInteger(); SqlHelper.log.WriteLog(lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_SearchPassWord); Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_SearchPassWord); ds = JW2DataInfo.JW2LoginDataInfo.SearchPassWord_Query(serverIP, serverName, usersn, username); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = Message.buildTLV(ds, 0, ds.Tables[0].Rows.Count, false); return(Message.COMMON_MES_RESP(structList, Msg_Category.JW2_ADMIN, ServiceKey.JW2_SearchPassWord_Query_Resp, (int)structList[0].structLen)); } else { return(Message.COMMON_MES_RESP(lg.JW2API_NoSearchPassWord, Msg_Category.JW2_ADMIN, ServiceKey.JW2_SearchPassWord_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog(lg.JW2API_QuerySearchPassWord + serverIP + lg.JW2API_PlayerAccount + username + "->" + ex.Message); return(Message.COMMON_MES_RESP(lg.JW2API_NoSearchPassWord, Msg_Category.JW2_ADMIN, ServiceKey.JW2_SearchPassWord_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 插入一个新的游戏 /// </summary> public Message GM_InsertGameInfo() { int result = -1; int userByID = 0; string gameName = null; string gameContent = null; GMLogAPI logApi = new GMLogAPI(); try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID = (int)strut.toInteger(); gameName = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.GameName).m_bValueBuffer); gameContent = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.GameContent).m_bValueBuffer); result = GMGameInfo.insertRow(userByID, gameName, gameContent); if (result == 1) { logApi.writeTitle(LanguageAPI.API_Add + LanguageAPI.API_GameInfoAPI_GameInfo, LanguageAPI.API_Add + LanguageAPI.API_GameInfoAPI_GameInfo + LanguageAPI.API_Success + "!"); logApi.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_GameInfoAPI_GameTitle, LanguageAPI.API_GameInfoAPI_GameDesp); logApi.writeData(Convert.ToString(userByID), gameName, gameContent); Console.WriteLine(logApi.Buffer.ToString()); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.GAME_ADMIN, ServiceKey.GAME_CREATE_RESP)); } else { logApi.writeTitle(LanguageAPI.API_Add + LanguageAPI.API_GameInfoAPI_GameInfo, LanguageAPI.API_Add + LanguageAPI.API_GameInfoAPI_GameInfo + LanguageAPI.API_Failure + "!"); logApi.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_GameInfoAPI_GameTitle, LanguageAPI.API_GameInfoAPI_GameDesp); logApi.writeData(Convert.ToString(userByID), gameName, gameContent); Console.WriteLine(logApi.Buffer.ToString()); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.GAME_ADMIN, ServiceKey.GAME_CREATE_RESP)); } } catch (Common.Logic.Exception ex) { return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.GAME_ADMIN, ServiceKey.GAME_CREATE_RESP)); } }
/// <summary> /// 删除一个模块信息 /// </summary> public Message GM_DelModuleInfo() { GMLogAPI logAPI = new GMLogAPI(); int result = -1; int moduleID = 0; int userByID = 0; try { TLV_Structure strut1 = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID = (int)strut1.toInteger(); TLV_Structure strut2 = new TLV_Structure(TagName.Module_ID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.Module_ID).m_bValueBuffer); moduleID = (int)strut2.toInteger(); result = GMModuleInfo.deleteRow(userByID, moduleID); if (result == 1) { logAPI.writeTitle(LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo, LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo + LanguageAPI.API_Success + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_GameInfoAPI_ModuleID, LanguageAPI.API_GameInfoAPI_ModuleDesp); logAPI.writeContent(Convert.ToString(userByID), Convert.ToString(moduleID), LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.Common_MODULE_DELETE_RESP(moduleID, "SUCESS")); } else { logAPI.writeTitle(LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo, LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo + LanguageAPI.API_Failure + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID, LanguageAPI.API_GameInfoAPI_ModuleID, LanguageAPI.API_GameInfoAPI_ModuleDesp); logAPI.writeContent(Convert.ToString(userByID), Convert.ToString(moduleID), LanguageAPI.API_Update + LanguageAPI.API_ModuleInfoAPI_ModuleInfo); Console.WriteLine(logAPI.Buffer.ToString()); return(Message.Common_MODULE_DELETE_RESP(moduleID, "FAILURE")); } } catch (SqlException ex) { Console.WriteLine(ex.Message); return(Message.Common_MODULE_DELETE_RESP(moduleID, "FAILURE")); } }
/// <summary> /// 查看道具使用期限 /// </summary> /// <returns></returns> public Message ItemLimit_Query() { DataSet ds = null; int itemcode = 0; try { TLV_Structure tlvStrut = new TLV_Structure(TagName.SDO_ProductID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.SDO_ProductID).m_bValueBuffer); itemcode = (int)tlvStrut.toInteger(); ds = ItemShopInfo.itemlimit_Query(itemcode); if (ds != null && ds.Tables[0].Rows.Count > 0) { return(Message.COMMON_MES_RESP(Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0].ToString()), Msg_Category.SDO_ADMIN, ServiceKey.SDO_DAYSLIMIT_QUERY_RESP, TagName.SDO_DaysLimit, TagFormat.TLV_INTEGER)); } else { return(Message.COMMON_MES_RESP("没有该道具的期限", Msg_Category.SDO_ADMIN, ServiceKey.SDO_DAYSLIMIT_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception e) { return(Message.COMMON_MES_RESP("没有该道具的期限", Msg_Category.SDO_ADMIN, ServiceKey.SDO_DAYSLIMIT_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 删除玩家身上道具 /// </summary> /// <returns></returns> public Message AvatarList_Delete() { int result = -1; int operateUserID = 0; int userIndexID = 0; string serverIP = null; int itemCode = 0; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.AU_ServerIP).m_bValueBuffer); TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.AU_UserSN, 4, msg.m_packet.m_Body.getTLVByTag(TagName.AU_UserSN).m_bValueBuffer); userIndexID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.AU_ItemID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.AU_ItemID).m_bValueBuffer); itemCode = (int)strut.toInteger(); result = AUAvatarListInfo.AvatarList_Delete(operateUserID, serverIP, userIndexID, itemCode); if (result == 1) { SqlHelper.log.WriteLog(lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUAvatarListAPI_Account + userIndexID + lg.AU_AUAvatarListAPI_AllBodyItem + itemCode + lg.API_Delete + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUAvatarListAPI_Account + userIndexID + lg.AU_AUAvatarListAPI_AllBodyItem + itemCode + lg.API_Delete + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.AU_ADMIN, ServiceKey.AU_ITEMSHOP_DELETE_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUAvatarListAPI_Account + userIndexID + lg.AU_AUAvatarListAPI_AllBodyItem + itemCode + lg.API_Delete + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.AU_AU + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.AU_AUAvatarListAPI_Account + userIndexID + lg.AU_AUAvatarListAPI_AllBodyItem + itemCode + lg.API_Delete + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.AU_ADMIN, ServiceKey.AU_ITEMSHOP_DELETE_RESP)); } } catch (System.Exception ex) { return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.AU_ADMIN, ServiceKey.AU_ITEMSHOP_DELETE_RESP)); } }
/// <summary> /// lg.SDAPI_SDItemLogInfoAPI_Account+lg.SDAPI_SDItemMsG4+lg.SDAPI_SDItemShopAPI_Integral+ /// </summary> /// <returns></returns> public Message SD_UserRank_query(int index, int pageSize) { string serverIP = null; //int uid = 0; DataSet ds = null; int userid = 0; int type = -1; string username = null; try { //lg.SDAPI_SDItemShopAPI_Integral+类型 TLV_Structure strut = new TLV_Structure(TagName.f_idx, 4, msg.m_packet.m_Body.getTLVByTag(TagName.SD_Type).m_bValueBuffer); type = (int)strut.toInteger(); serverIP = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.SD_ServerIP).m_bValueBuffer); SqlHelper.log.WriteLog(lg.SDAPI_SDItemMsG + lg.SDAPI_SD + "+>" + lg.SDAPI_SDItemMsG1 + CommonInfo.serverIP_Query(serverIP) + lg.SDAPI_SDItemLogInfoAPI_Account + username + lg.SDAPI_SDItemMsG4 + lg.SDAPI_SDItemShopAPI_Integral + "!"); Console.WriteLine(DateTime.Now + " - " + lg.SDAPI_SDItemMsG + lg.SDAPI_SD + "+>" + lg.SDAPI_SDItemMsG1 + CommonInfo.serverIP_Query(serverIP) + lg.SDAPI_SDItemLogInfoAPI_Account + username + lg.SDAPI_SDItemMsG4 + lg.SDAPI_SDItemShopAPI_Integral + "!"); ds = SDAccountInfo.UserRank_Query(serverIP, type); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = Message.buildTLV(ds, index, pageSize, false); return(Message.COMMON_MES_RESP(structList, Msg_Category.SD_ADMIN, ServiceKey.SD_Firend_Query_Resp, (int)structList[0].structLen)); } else { return(Message.COMMON_MES_RESP(lg.SDAPI_SDItemMsG5 + lg.SDAPI_SDChallengeDataAPI_NoChallengeScene + lg.SDAPI_SDItemLogInfoAPI_Account + lg.SDAPI_SDItemMsG4 + lg.SDAPI_SDItemShopAPI_Integral, Msg_Category.SD_ADMIN, ServiceKey.SD_Firend_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog(lg.SDAPI_SDItemMsG1 + serverIP + ex.Message); return(Message.COMMON_MES_RESP(lg.SDAPI_SDItemMsG5 + lg.SDAPI_SDChallengeDataAPI_NoChallengeScene + lg.SDAPI_SDItemLogInfoAPI_Account + lg.SDAPI_SDItemMsG4 + lg.SDAPI_SDItemShopAPI_Integral, Msg_Category.SD_ADMIN, ServiceKey.SD_Firend_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 查看玩家纸条箱信息 /// </summary> /// <returns></returns> public Message JW2_MailInfo_Query(int index, int pageSize) { string serverIP = ""; //int uid = 0; DataSet ds = null; string EndTime = ""; string BeginTime = ""; int userSN = 0; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); BeginTime = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.BeginTime).m_bValueBuffer); EndTime = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.EndTime).m_bValueBuffer); TLV_Structure strut = new TLV_Structure(TagName.JW2_UserSN, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserSN).m_bValueBuffer); userSN = (int)strut.toInteger(); SqlHelper.log.WriteLog("浏览劲舞团2+>服务器地址" + CommonInfo.serverIP_Query(serverIP) + "玩家:" + userSN + "纸条箱信息!"); Console.WriteLine(DateTime.Now + " - 浏览劲舞团2+>服务器地址" + CommonInfo.serverIP_Query(serverIP) + "玩家:" + userSN + "纸条箱信息!"); ds = JW2DataInfo.JW2MessengerDataInfo.MailInfo_Query(serverIP, userSN, BeginTime, EndTime); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = Message.JW2_buildTLV(ds, index, pageSize, false, serverIP); return(Message.COMMON_MES_RESP(structList, Msg_Category.JW2_ADMIN, ServiceKey.JW2_MailInfo_Query_Resp, (int)structList[0].structLen)); } else { return(Message.COMMON_MES_RESP("没有该玩家纸条箱信息", Msg_Category.JW2_ADMIN, ServiceKey.JW2_MailInfo_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog("查看玩家纸条箱信息->JW2_MailInfo_Query->服务器IP->" + serverIP + "->用户->" + userSN + "->开始时间->" + BeginTime + "->结束时间->" + EndTime + "->" + ex.Message); return(Message.COMMON_MES_RESP("没有该玩家纸条箱信息", Msg_Category.JW2_ADMIN, ServiceKey.JW2_MailInfo_Query_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 查看玩家消费记录 /// </summary> /// <returns></returns> public Message UserConsume_QuerySum() { string serverIP = null; string account = null; DateTime beginDate; DateTime endDate; int moneyType = -1; DataSet ds = null; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.O2JAM2_ServerIP).m_bValueBuffer); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.O2JAM2_UserID).m_bValueBuffer); TLV_Structure tlvStrut = new TLV_Structure(TagName.O2JAM2_BeginDate, 3, msg.m_packet.m_Body.getTLVByTag(TagName.O2JAM2_BeginDate).m_bValueBuffer); beginDate = tlvStrut.toDate(); tlvStrut = new TLV_Structure(TagName.O2JAM2_ENDDate, 3, msg.m_packet.m_Body.getTLVByTag(TagName.O2JAM2_ENDDate).m_bValueBuffer); endDate = tlvStrut.toDate(); tlvStrut = new TLV_Structure(TagName.O2JAM2_ComsumeType, 4, msg.m_packet.m_Body.getTLVByTag(TagName.O2JAM2_ComsumeType).m_bValueBuffer); moneyType = (int)tlvStrut.toInteger(); SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM2API_BAF + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM2API_AccountInfoAPI_Account + account + lg.O2JAM2API_ItemShopAPI_SumConsumeRecord); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM2API_BAF + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM2API_AccountInfoAPI_Account + account + lg.O2JAM2API_ItemShopAPI_SumConsumeRecord); ds = ItemShopInfo.userConsume_QuerySum(serverIP, account, moneyType, beginDate, endDate); if (ds != null && ds.Tables[0].Rows.Count > 0) { return(Message.COMMON_MES_RESP(Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0]), Msg_Category.O2JAM2_ADMIN, ServiceKey.O2JAM2_CONUMSE_QUERY_SUM_RESP, TagName.SDO_ChargeSum, TagFormat.TLV_INTEGER)); } else { return(Message.COMMON_MES_RESP(lg.O2JAM2API_ItemShopAPI_NoSumConsumeRecord, Msg_Category.O2JAM2_ADMIN, ServiceKey.O2JAM2_CONUMSE_QUERY_SUM_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { return(Message.COMMON_MES_RESP(lg.O2JAM2API_AccountInfoAPI_NoAccount, Msg_Category.O2JAM2_ADMIN, ServiceKey.O2JAM2_CONUMSE_QUERY_SUM_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 删除玩家礼物盒上道具 /// </summary> /// <returns></returns> public Message GiftBox_MessageItem_Delete() { int result = -1; int operateUserID = 0; int userIndexID = 0; string serverIP = null; int itemCode = 0; try { serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_ServerIP).m_bValueBuffer); TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_USER_INDEX_ID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_USER_INDEX_ID).m_bValueBuffer); userIndexID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_ITEM_INDEX_ID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_ITEM_INDEX_ID).m_bValueBuffer); itemCode = (int)strut.toInteger(); result = ItemShopInfo.giftBox_Delete(operateUserID, serverIP, userIndexID, itemCode); if (result == 1) { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.O2JAM_ItemShopInfoAPI_GiftItem + itemCode + lg.API_Delete + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.O2JAM_ItemShopInfoAPI_GiftItem + itemCode + lg.API_Delete + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.O2JAM_ItemShopInfoAPI_GiftItem + itemCode + lg.API_Delete + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + userIndexID + lg.O2JAM_ItemShopInfoAPI_GiftItem + itemCode + lg.API_Delete + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP)); } } catch (System.Exception ex) { return(Message.COMMON_MES_RESP(lg.O2JAM_ItemShopInfoAPI_NoItemOnGift, Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_ITEM_UPDATE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 添加GM帳號 /// </summary> /// <returns></returns> public Message GMAccount_Update() { int operateUserID = 0; string serverIP = null; string account = null; int accountState = 0; int result = -1; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_ServerIP).m_bValueBuffer); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_NyUserID).m_bValueBuffer); strut = new TLV_Structure(TagName.RayCity_AccountState, 4, msg.m_packet.m_Body.getTLVByTag(TagName.RayCity_AccountState).m_bValueBuffer); accountState = (int)strut.toInteger(); result = GlobalAccount.GMAccount_Update(operateUserID, serverIP, account, accountState); if (result == 1) { SqlHelper.log.WriteLog(lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.RayCityAPI_GMAccount + account + lg.API_Success); Console.WriteLine(DateTime.Now + lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.RayCityAPI_GMAccount + account + lg.API_Success); return(Message.COMMON_MES_RESP("SUCCESS", Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_GMUser_Update_Resp, TagName.Status, TagFormat.TLV_STRING)); } else { SqlHelper.log.WriteLog(lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.RayCityAPI_GMAccount + account + lg.API_Failure); Console.WriteLine(DateTime.Now + lg.API_Look + lg.RayCityAPI_Name + "+>" + lg.RayCityAPI_Address + CommonInfo.serverIP_Query(serverIP) + lg.API_Add + lg.RayCityAPI_GMAccount + account + lg.API_Failure); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_GMUser_Update_Resp, TagName.Status, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog("伺服器IP" + serverIP + ex.Message); return(Message.COMMON_MES_RESP(lg.API_Error, Msg_Category.RAYCITY_ADMIN, ServiceKey.RayCity_GMUser_Update_Resp, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 删除一个用户信息 /// </summary> public Message GM_DelUserInfo() { int result = -1; int userID = 0; int userByID = 0; try { TLV_Structure strut1 = new TLV_Structure(TagName.User_ID,4,msg.m_packet.m_Body.getTLVByTag(TagName.User_ID).m_bValueBuffer); userID =(int)strut1.toInteger(); TLV_Structure strut2 = new TLV_Structure(TagName.UserByID,4,msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userByID =(int)strut2.toInteger(); result = GMUserInfo.deleteRow(userID,userByID); if(result==1) { logAPI.writeTitle(LanguageAPI.API_Delete + LanguageAPI.API_UserInfoAPI_AccountInfo,LanguageAPI.API_Delete + LanguageAPI.API_UserInfoAPI_AccountInfo + LanguageAPI.API_Success + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID,LanguageAPI.API_UserInfoAPI_UserID,LanguageAPI.API_UserInfoAPI_LimitDay); logAPI.writeData(Convert.ToString(userByID),Convert.ToString(userID),LanguageAPI.API_Delete); Console.WriteLine(logAPI.Buffer.ToString()); return Message.Common_USER_DELETE_RESP("SUCESS"); } else { logAPI.writeTitle(LanguageAPI.API_Delete + LanguageAPI.API_UserInfoAPI_AccountInfo,LanguageAPI.API_Delete + LanguageAPI.API_UserInfoAPI_AccountInfo + LanguageAPI.API_Failure + "!"); logAPI.writeContent(LanguageAPI.API_DepartmentAPI_OperatorID,LanguageAPI.API_UserInfoAPI_UserID,LanguageAPI.API_UserInfoAPI_LimitDay); logAPI.writeData(Convert.ToString(userID),Convert.ToString(userByID),LanguageAPI.API_Delete); Console.WriteLine(logAPI.Buffer.ToString()); return Message.Common_USER_DELETE_RESP("FAILURE"); } } catch(SqlException ex) { Console.WriteLine(ex.Message); return Message.Common_USER_DELETE_RESP("FAILURE"); } }
/// <summary> /// 玩家资料信息查询 /// </summary> /// <returns></returns> public Message CR_CharacterInfo_Query() { System.Data.DataSet ds = null; string serverIP = null; string account = ""; string nickName = ""; int actionType = 0; try { serverIP = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.CR_ServerIP).m_bValueBuffer); TLV_Structure strut1 = new TLV_Structure(TagName.CR_ACTION, 4, msg.m_packet.m_Body.getTLVByTag(TagName.CR_ACTION).m_bValueBuffer); actionType = (int)strut1.toInteger(); if (actionType == 1) { account = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.CR_ACCOUNT).m_bValueBuffer); } else if (actionType == 2) { nickName = System.Text.Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.CR_NickName).m_bValueBuffer); } SqlHelper.log.WriteLog(lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_AccountInfoAPI_Account + account + lg.CR_AccountInfoAPI_AccountInfo); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.CR_CR + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.CR_AccountInfoAPI_Account + account + lg.CR_AccountInfoAPI_AccountInfo); ds = CRCharacterInfo.CR_CharacterInfo_Query(serverIP, account, nickName, actionType); if (ds != null && ds.Tables[0].Rows.Count > 0) { Query_Structure[] structList = new Query_Structure[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Query_Structure strut = new Query_Structure((uint)ds.Tables[0].Rows[i].ItemArray.Length); byte[] bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, UserValidate.validData(ds.Tables[0].Rows[0].ItemArray[0])); strut.AddTagKey(TagName.CR_ACCOUNT, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_STRING, UserValidate.validData(ds.Tables[0].Rows[0].ItemArray[1])); strut.AddTagKey(TagName.CR_NickName, TagFormat.TLV_STRING, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[2])); strut.AddTagKey(TagName.CR_PSTID, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[3])); strut.AddTagKey(TagName.CR_EXP, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[4])); strut.AddTagKey(TagName.CR_Money, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[5])); strut.AddTagKey(TagName.CR_RMB, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[6])); strut.AddTagKey(TagName.CR_SEX, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[7])); strut.AddTagKey(TagName.CR_License, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[8])); strut.AddTagKey(TagName.CR_RaceTotal, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[9])); strut.AddTagKey(TagName.CR_RaceWon, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[10])); strut.AddTagKey(TagName.CR_ExpOrder, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[11])); strut.AddTagKey(TagName.CR_WinRateOrder, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); bytes = TLV_Structure.ValueToByteArray(TagFormat.TLV_INTEGER, Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[12])); strut.AddTagKey(TagName.CR_WinNumOrder, TagFormat.TLV_INTEGER, (uint)bytes.Length, bytes); structList[i] = strut; } return(Message.COMMON_MES_RESP(structList, Msg_Category.CR_ADMIN, ServiceKey.CR_CHARACTERINFO_QUERY_RESP, 13)); } else { return(Message.COMMON_MES_RESP(lg.CR_AccountInfoAPI_NoAccount, Msg_Category.CR_ADMIN, ServiceKey.CR_CHARACTERINFO_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception) { return(Message.COMMON_MES_RESP(lg.CR_AccountInfoAPI_NoAccount, Msg_Category.CR_ADMIN, ServiceKey.CR_CHARACTERINFO_QUERY_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 公告添加 /// </summary> /// <returns></returns> public Message JW2_BOARDTASK_INSERT() { string serverIP = ""; string GSserverIP = ""; int result = -1; string BoardMessage = ""; string BeginTime = ""; string EndTime = ""; int Interval = 0; int userbyid = 0; try { //ip serverIP = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); // serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); //操作员id TLV_Structure strut = new TLV_Structure(TagName.Magic_PetID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userbyid = (int)strut.toInteger(); //GSserverIP GSserverIP = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_GSServerIP).m_bValueBuffer); //公告内容 BoardMessage = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_BoardMessage).m_bValueBuffer); //开始时间 BeginTime = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_BeginTime).m_bValueBuffer); //结束时间 EndTime = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_EndTime).m_bValueBuffer); // GSserverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_GSServerIP).m_bValueBuffer); // //公告内容 // BoardMessage = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_BoardMessage).m_bValueBuffer); // //开始时间 // BeginTime = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_BeginTime).m_bValueBuffer); // //结束时间 // EndTime = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_EndTime).m_bValueBuffer); //间隔 strut = new TLV_Structure(TagName.Magic_PetID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_Interval).m_bValueBuffer); Interval = (int)strut.toInteger(); SqlHelper.log.WriteLog(lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_BOARDTASKINSERT); Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_BOARDTASKINSERT); result = JW2DataInfo.JW2LoginDataInfo.BOARDTASK_INSERT(serverIP, GSserverIP, BoardMessage, BeginTime, EndTime, userbyid, Interval); if (result == 1) { SqlHelper helper = new SqlHelper(); int iiii = 0; string DatabaseIP = ConfigurationSettings.AppSettings["DatabaseIP"]; string DatabaseName = ConfigurationSettings.AppSettings["DatabaseName"]; string DatabaseUser = ConfigurationSettings.AppSettings["DatabaseUser"]; string DatabasePass = ConfigurationSettings.AppSettings["DatabasePass"]; helper.init(DatabaseIP, DatabaseName, DatabaseUser, DatabasePass); string SqlStr = "select interval*1000*60,taskID,datediff(mi,getdate(),SendEndTime) as expire,datediff(mi,getdate(),SendBeginTime) as start,status,command,boardMessage,datediff(mi,getdate(),SendBeginTime),atonce from JW2_boardTasker where (status=0 or status=2)"; System.Data.DataSet ds = SqlHelper.ExecuteDataset(SqlStr); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int interval = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[0]); int taskID = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[1]); int timeOut = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[2]); int timeStart = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[3]); int status = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[4]); int command = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[5].ToString()); string context = ds.Tables[0].Rows[i].ItemArray[6].ToString(); int startTime = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[7].ToString()); int atonce = Convert.ToInt32(ds.Tables[0].Rows[i].ItemArray[8].ToString()); TaskBulletion task = new TaskBulletion(i); task.status = status; task.taskID = taskID; task.timeOut = timeOut; task.timeStart = timeStart; task.command = command; task.interval = interval; task.context = context; task.atonce = atonce; task.process(task.taskID); } } string SqlStr_U = "update JW2_boardTasker set status=1 where status=0 or status=2"; //即时公告发送后结束 SqlHelper.ExecCommand(SqlStr_U); Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_BOARDTASKINSERT + lg.JW2API_Success); return(Message.COMMON_MES_RESP("SCUESS", Msg_Category.JW2_ADMIN, ServiceKey.JW2_BOARDTASK_INSERT_RESP)); } else { Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_BOARDTASKINSERT + lg.JW2API_Failure); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.JW2_ADMIN, ServiceKey.JW2_BOARDTASK_INSERT_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog(lg.JW2API_QueryBOARDTASKINSERT + serverIP + lg.JW2API_BeginTime + BeginTime + lg.JW2API_EndTime + EndTime + "->" + ex.Message); return(Message.COMMON_MES_RESP(lg.JW2API_BOARDTASKINSERT, Msg_Category.JW2_ADMIN, ServiceKey.JW2_BOARDTASK_INSERT_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }
/// <summary> /// 玩家资料信息修改 /// </summary> /// <returns></returns> public Message O2JAMCharacterInfo_Update() { int result = -1; string serverIP = null; int userIndexID = 0; string account = null; int level = 0; int experience = 0; int operateUserID = 0; int battle = 0; int win = 0; int draw = 0; int lose = 0; int GCash = 0; try { TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); operateUserID = (int)strut.toInteger(); serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_ServerIP).m_bValueBuffer); account = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_UserID).m_bValueBuffer); strut = new TLV_Structure(TagName.o2jam_USER_INDEX_ID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_USER_INDEX_ID).m_bValueBuffer); userIndexID = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Level, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Level).m_bValueBuffer); level = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Exp, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Exp).m_bValueBuffer); experience = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Battle, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Battle).m_bValueBuffer); battle = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Win, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Win).m_bValueBuffer); win = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Draw, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Draw).m_bValueBuffer); draw = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_Lose, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_Lose).m_bValueBuffer); lose = (int)strut.toInteger(); strut = new TLV_Structure(TagName.o2jam_GEM, 4, msg.m_packet.m_Body.getTLVByTag(TagName.o2jam_GEM).m_bValueBuffer); GCash = (int)strut.toInteger(); result = CharacterInfo.characterInfo_Update(operateUserID, serverIP, account, userIndexID, level, experience, battle, win, draw, lose, GCash); if (result == -1) { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.O2JAM_CharacterInfoAPI_NoAccount); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.O2JAM_CharacterInfoAPI_NoAccount); return(Message.COMMON_MES_RESP(lg.O2JAM_CharacterInfoAPI_NoAccount, Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_CHARACTERINFO_UPDATE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } else if (result == 1) { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.API_Update + lg.O2JAM_CharacterInfoAPI_CharacterInfo + lg.API_Success + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.API_Update + lg.O2JAM_CharacterInfoAPI_CharacterInfo + lg.API_Success + "!"); return(Message.COMMON_MES_RESP("SUCESS", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_CHARACTERINFO_UPDATE_RESP)); } else { SqlHelper.log.WriteLog(lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.API_Update + lg.O2JAM_CharacterInfoAPI_CharacterInfo + lg.API_Failure + "!"); Console.WriteLine(DateTime.Now + " - " + lg.API_Display + lg.O2JAM_O2JAM + "+>" + lg.API_CommonAPI_ServerIP + CommonInfo.serverIP_Query(serverIP) + lg.O2JAM_CharacterInfoAPI_Account + account + lg.API_Update + lg.O2JAM_CharacterInfoAPI_CharacterInfo + lg.API_Failure + "!"); return(Message.COMMON_MES_RESP("FAILURE", Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_CHARACTERINFO_UPDATE_RESP)); } } catch (System.Exception ex) { Console.WriteLine(ex.Message); return(Message.COMMON_MES_RESP(ex.Message, Msg_Category.O2JAM_ADMIN, ServiceKey.O2JAM_CHARACTERINFO_UPDATE_RESP)); } }
/// <summary> /// 封停用户 /// </summary> /// <returns></returns> public Message JW2_ACCOUNT_CLOSE() { string strDesc = ""; string serverIP = ""; int result = -1; string userid = ""; string Reason = ""; int userSN = 0; string UserName = ""; string UserNick = ""; string charkey = ""; int userbyid = 0; try { //ip // serverIP = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); serverIP = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_ServerIP).m_bValueBuffer); //操作员id TLV_Structure strut = new TLV_Structure(TagName.UserByID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.UserByID).m_bValueBuffer); userbyid = (int)strut.toInteger(); //昵称 // UserNick = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserNick).m_bValueBuffer); // //用户名 // UserName = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserID).m_bValueBuffer); //昵称 UserNick = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserNick).m_bValueBuffer); //用户名 UserName = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserID).m_bValueBuffer); //角色id strut = new TLV_Structure(TagName.Magic_PetID, 4, msg.m_packet.m_Body.getTLVByTag(TagName.JW2_UserSN).m_bValueBuffer); userSN = (int)strut.toInteger(); //封停原因 // Reason = Encoding.Default.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_Reason).m_bValueBuffer); Reason = Encoding.Unicode.GetString(msg.m_packet.m_Body.getTLVByTag(TagName.JW2_Reason).m_bValueBuffer); SqlHelper.log.WriteLog(lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_ACCOUNTCLOSE + UserNick); Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_ACCOUNTCLOSE + UserNick); // if(JW2DataInfo.JW2LoginDataInfo.BANISHPLAYER(serverIP,UserName,userbyid,ref strDesc)==0) // { result = JW2DataInfo.JW2LoginDataInfo.ACCOUNT_CLOSE(serverIP, userSN, UserNick, UserName, userbyid, Reason, ref strDesc); if (result == 1) { Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_ACCOUNTCLOSE + UserNick + lg.JW2API_Success); return(Message.COMMON_MES_RESP(strDesc, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ACCOUNT_CLOSE_RESP)); } else if (result == 2) { Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_PlayerAccount + UserNick + lg.JW2API_Success); return(Message.COMMON_MES_RESP("this user has been AccountClose", Msg_Category.JW2_ADMIN, ServiceKey.JW2_ACCOUNT_CLOSE_RESP)); } else { Console.WriteLine(DateTime.Now + lg.JW2API_BrowseServerAddress + CommonInfo.serverIP_Query(serverIP) + lg.JW2API_ACCOUNTCLOSE + UserNick + lg.JW2API_Failure); return(Message.COMMON_MES_RESP(strDesc, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ACCOUNT_CLOSE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } // } // else // { // Console.WriteLine(DateTime.Now+" - 浏览劲舞团2+>服务器地址"+CommonInfo.serverIP_Query(serverIP)+"封停玩家"+UserNick+"失败"); // return Message.COMMON_MES_RESP(strDesc,Msg_Category.JW2_ADMIN,ServiceKey.JW2_ACCOUNT_CLOSE_RESP,TagName.ERROR_Msg,TagFormat.TLV_STRING); // } } catch (System.Exception ex) { SqlHelper.errLog.WriteLog(lg.JW2API_QueryACCOUNTCLOSE + serverIP + lg.JW2API_PlayerAccount + UserName + "->" + ex.Message); return(Message.COMMON_MES_RESP(lg.JW2API_NoACCOUNTCLOSE, Msg_Category.JW2_ADMIN, ServiceKey.JW2_ACCOUNT_CLOSE_RESP, TagName.ERROR_Msg, TagFormat.TLV_STRING)); } }