public void RemovePlayer(GameCharacter.Player p) { p.RemoveSeenByAllOther(); characters_players.Remove(p); characters.Remove(p); Log.Log("Removed player: " + p.Info.Name + "/" + p.Id); }
private void UpdatePlayerMapView(GameCharacter.Player p) { throw new NotImplementedException(); /* * //Give whole map for now * Single[,] block; * for (int i = 0; i < map.Terrain.NumBlocksX; i++) * { * for (int j = 0; j < map.Terrain.NumBlocksY; j++) * { * block = map.Terrain.GetBlock(i, j); * p.SendPacket(new ClientToInstancePackets.Map_TerrainBlock_c(i, j, block)); * } * } * */ }
public void AddPlayer(GameCharacter.Player p, Position2D position = null) { if (position != null) { p.Position.Set(position); } p.SetID(NextCharacterID); characters.Add(p); characters_players.Add(p); //p.SendPacket(new ClientToInstancePackets.Map_Reset_c(map., map.Terrain.NumBlocksY)); p.SendPacket(new ClientToInstancePackets.Character_Add_c(p.Id, CharacterType.Player, p.Info.Name)); p.SendPacket(new ClientToInstancePackets.Character_Position_c(p.Id, p.Position.x, p.Position.y)); p.SendPacket(new ClientToInstancePackets.Player_SetControl_c(p.Id)); p.SendPacket(new ClientToInstancePackets.Character_UpdateStats_c(p.Id, p.Stats)); UpdatePlayerMapView(p); UpdateCharacterView(p); Log.Log("Added player: " + p.Info.Name + "/" + p.Id); }