コード例 #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
ファイル: Player.cs プロジェクト: kedlly/XDFramework
 public GamePlayerProxy(GamePlayerInfo playerInfo)
 {
     this.PlayerInfo = playerInfo;
 }