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.
72 lines
2.4 KiB
72 lines
2.4 KiB
/*
|
|
Sog 游戏基础库
|
|
2016 by zouwei
|
|
*/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
using Sog;
|
|
using ProtoCSStruct;
|
|
|
|
namespace Chat
|
|
{
|
|
// 系统消息: ping chat sysnotice
|
|
public static class SysHandler
|
|
{
|
|
public static int ProcessPing(PlayerOnChat playerSession, StructPacket packet)
|
|
{
|
|
ref CSPing pingReq = ref packet.GetMessage<CSPing>();
|
|
|
|
long now = ChatServerUtils.GetApp().Time.GetTime();
|
|
pingReq.ServerTime = now;
|
|
PlayerPacketSender.SendToPlayer<CSPing>(playerSession, packet);
|
|
|
|
//在ping的时候给客户端发送新的系统消息跑马灯
|
|
//SysNoticeLampUtils.NoticePlayerNewSysNoticeLamp(playerSession);
|
|
//SysNoticeUtils.NoticePlayerNewSysNotice(playerSession);
|
|
return 0;
|
|
}
|
|
|
|
public static void ProcessChatPing(PlayerOnChat playerSession, StructPacket packet)
|
|
{
|
|
ref CSChatPing pingReq = ref packet.GetMessage<CSChatPing>();
|
|
//客户端发给服务器
|
|
pingReq.ServerTime = ChatServerUtils.GetApp().Time.GetTime();
|
|
PlayerPacketSender.SendToPlayer<CSChatPing>(playerSession, packet);
|
|
|
|
//在ping的时候给客户端发送新的系统消息跑马灯
|
|
//SysNoticeLampUtils.NoticePlayerNewSysNoticeLamp(playerSession);
|
|
//SysNoticeUtils.NoticePlayerNewSysNotice(playerSession);
|
|
}
|
|
|
|
public static void OnQuerySysnoticeReq(PlayerOnChat playerSession, StructPacket packet)
|
|
{
|
|
ref var req = ref packet.GetMessage<CSQuerySysNoticeReq>();
|
|
CSQuerySysNoticeRes res = new CSQuerySysNoticeRes();
|
|
// 先拉去客户端请求语言
|
|
SysNoticeSvc.FillSysNotices(ref res, playerSession, req.Seq, req.Lang.GetString());
|
|
|
|
if (req.Lang.GetString().ToLower() != "en")
|
|
{
|
|
//公告请求为0 且,请求语言不为英语,拉取一遍英文公告
|
|
if (res.PopupList.Count == 0)
|
|
{
|
|
SysNoticeSvc.FillSysNotices(ref res, playerSession, req.Seq, "en", 1);
|
|
}
|
|
|
|
if (res.ClickList.Count == 0)
|
|
{
|
|
SysNoticeSvc.FillSysNotices(ref res, playerSession, req.Seq, "en", 2);
|
|
}
|
|
}
|
|
|
|
PlayerPacketSender.SendToPlayer(playerSession, (int)CSGameMsgID.QuerySysnoticeRes, ref res);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|