/// <summary> 推送玩家回到出生地</summary> /// <param name="session">当前玩家session</param> private void PushBack(TGGSession session) { var list = Variable.Activity.ScenePlayer.Where(m => m.Value.model_number == (int)ModuleNumber.SIEGE && m.Key != Common.GetInstance().GetKey(session.Player.User.id)); foreach (var item in list) { var token = new CancellationTokenSource(); Task.Factory.StartNew( m => PUSH_PLAYER_POS.GetInstance().CommandStart(session, Convert.ToInt64(m), (int)SiegePointType.BIRTHPLACE, 0), item.Value.user_id, token.Token); } }
/// <summary>场景内其他玩家数据 并将当前玩家数据推送给其他玩家</summary> private void OtherPlayerPush(TGGSession session, int entryid) { var user = session.Player.User; //var otherplayer = Variable.Activity.Siege.PlayerData.Where(m => m.user_id != user.id).ToList(); var otherplayer = Common.GetInstance().GetOtherSceneUsers(user.id); foreach (var item in otherplayer) { //if (!Common.GetInstance().IsActivities(item.user_id)) continue; var token = new CancellationTokenSource(); Task.Factory.StartNew( m => PUSH_PLAYER_POS.GetInstance().CommandStart(session, Convert.ToInt64(m), (int)SiegePointType.POINT, entryid), item.user_id, token.Token); } }
/// <summary>PUSH_PLAYER_POS单体模式</summary> public static PUSH_PLAYER_POS GetInstance() { return(ObjInstance ?? (ObjInstance = new PUSH_PLAYER_POS())); }