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(); } }
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(); } }
public void SetCurrentPlayer(GamePlayerInfo player) { Current = player; AddPlayer(Current); }
public void Drop(GamePlayerInfo player) { Drop(player.ID); }
public void AddPlayer(GamePlayerInfo player) { players.Add(player.ID, player); player.Attach(); }
public GamePlayerProxy(GamePlayerInfo playerInfo) { this.PlayerInfo = playerInfo; }