You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
2.0 KiB

using ProtoCSStruct;
using Sog;
using Sog.Log;
namespace Rank
{
public static class SysSvc
{
public static void OnAddServerTimeSync(uint remoteAppID, StructPacket packet)
{
ref SSAddServerTimeSync sync = ref packet.GetMessage<SSAddServerTimeSync>();
TraceLog.Debug("SysSvc.OnAddServerTimeSync serverid {0} offset {1}"
, ServerIDUtils.IDToString(remoteAppID), sync.Offset);
RankServerUtils.GetApp().Time.SetOffset(sync.Offset);
RankServerUtils.GetApp().Time.UpdateTime();
TraceLog.Debug("SysSvc.OnAddServerTimeSync serverid {0} offset {1} set time success"
, ServerIDUtils.IDToString(remoteAppID), sync.Offset);
}
public static void OnMailOpRes(uint remoteAppID, StructPacket packet)
{
ref SSMailOpRes res = ref packet.GetMessage<SSMailOpRes>();
// 只支持发送邮件操作
if (res.OpType != (int)MailOpType.Insert)
{
TraceLog.Error("SysSvc.OnMailOpRes invalid mailOp {0}", res.OpType);
return;
}
TraceLog.Debug("SysSvc.OnMailOpRes uniqueId {0} uid {1} mail {2}",
res.UniqueID, res.Mail.Uid, res.Mail.MailID);
// rank只会insert奖励邮件, 收到DB的res就算成功, 因为收到DB操作失败rank也无法处理
// 如果收到res不删除, 邮件可能会滚雪球越积越多
if (res.UniqueID != 0)
{
WaitAckStructRequestSender.Instance.OnReceiveSuccess(res.UniqueID);
}
// 发送失败时,打日志,220201表示邮件已经存在
if (res.Ret != 0 && res.Ret != 220201)
{
TraceLog.Error("SysSvc.OnMailOpRes failed uid {0}, mail {1}", res.Mail.Uid, res.Mail.MailID);
}
CommBillLogUtils.LogMailOpRet(res.ClientOpUid, res.Mail, res.OpType, res.Ret);
}
}
}