示例#1
0
        static void RPC_Respond_LoginAuth(Respond_LoginAuth rla)
        {
            GamePlayerInfo player = new GamePlayerInfo(rla.player.pid
                                                       , rla.token
                                                       , rla.player.name
                                                       , rla.player.playerType.ToGamePlayerType()
                                                       );

            player.Position = rla.player.movement.position.ToUV();
            player.Velocity = rla.player.movement.velocity.ToUV();

            if (PlayerManager.Instance.Current == null)
            {
                PlayerManager.Instance.SetCurrentPlayer(player);
                player.Login();
            }
            foreach (var p in rla.neighborhood)
            {
                GamePlayerInfo pc = new GamePlayerInfo(p.pid
                                                       , name: p.name
                                                       , type: p.playerType.ToGamePlayerType()
                                                       );
                pc.Position = p.movement.position.ToUV();
                pc.Velocity = p.movement.velocity.ToUV();
                PlayerManager.Instance.AddPlayer(pc);
                pc.Appear();
            }
        }
示例#2
0
 static void RPC_Respond_PlayerAppeared(Respond_PlayerAppeared rpa)
 {
     foreach (var m in rpa.neighborhood)
     {
         var player = PlayerManager.Instance.GetPlayer(m.pid);
         if (player == null)
         {
             player = new GamePlayerInfo(m.pid
                                         , name: m.name
                                         , type: m.playerType.ToGamePlayerType()
                                         );
             player.Position = m.movement.position.ToUV();
             player.Velocity = m.movement.velocity.ToUV();
             PlayerManager.Instance.AddPlayer(player);
             player.Appear();
         }
         player.Position = m.movement.position.ToUV();
         player.Velocity = m.movement.velocity.ToUV();
         player.RefreshMovment();
     }
 }
示例#3
0
 public void SetCurrentPlayer(GamePlayerInfo player)
 {
     Current = player;
     AddPlayer(Current);
 }
示例#4
0
 public void Drop(GamePlayerInfo player)
 {
     Drop(player.ID);
 }
示例#5
0
 public void AddPlayer(GamePlayerInfo player)
 {
     players.Add(player.ID, player);
     player.Attach();
 }
示例#6
0
 public GamePlayerProxy(GamePlayerInfo playerInfo)
 {
     this.PlayerInfo = playerInfo;
 }