using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; namespace Game { public static class FriendSvc { public static void OnDailyStatisticsChanged(PlayerOnGame player, int statid, long newValue, long change) { player.Trace("FriendSvc.OnDailyStatisticsChanged uid {0} id {1} newvalue {2}", player.UserID, statid, newValue); //if (newValue > 0 && change > 0) //{ //if(statid == (int)CSRoleStatisticsID.TotalWin || statid == (int)CSRoleStatisticsID.WinChip) //{ // SSFriendPlayerStatChgNotify notify = new SSFriendPlayerStatChgNotify(); // notify.Statid = statid; // notify.NewValue = newValue; // notify.Change = change; // GameServerUtils.GetPacketSender().SendToWorldServer((int)SSGameMsgID.FriendPlayerStatChgNotify, ref notify, player.UserID); //} //} } public static void OnPlayerOnline(PlayerOnGame player) { SSQueryFriendListReq ssreq = new SSQueryFriendListReq(); ssreq.Uid = player.UserID; //不存在则向world查询 GameServerUtils.GetPacketSender().SendToWorldServer((int)SSGameMsgID.QueryFriendListReq, ref ssreq, player.UserID); } public static void CopyPlayerDataToFriendOne(PlayerOnGame player, ref DBFriendOne friend) { friend.FriendType = 0; friend.Icon.SetString( player.GetIcon()); friend.Uid = player.UserID; friend.Nick.SetString( player.GetNick()); friend.Level = player.GetLevel(); friend.LastLoginTime = player.RoleBase.LastLoginTime; friend.VipExp = player.GetVipExp(); friend.VipLevel = player.GetVipLevel(); friend.Chip = player.GetGold(); friend.Gender = player.RoleBase.Gender; } } }