public void AddPlayer(PlayerCarac carac, ActorRTInfo info, NetConnection co) { // Container creation Player player = new Player(); player.Carac = carac; player.Info = info; if (co != null) { player.Connection = co; co.Tag = carac.ActorID; } player.score = new PlayerScore(); // And finally add it to our list List.Add(player.Carac.ActorID, player); }
// Create a player from a partially constructed PlayerCarac and return its ID public int CreatePlayer(PlayerCarac carac, NetConnection co) { carac.AssignID(); ActorRTInfo info = new ActorRTInfo(); // Set Physical infos info.Health = carac.HealthCap = 100; info.Mana = carac.ManaCap = 100; info.Weapon = 1; // Set position info info.Position = 1.0f; info.Velocity = 0.0f; // And add the player AddPlayer(carac, info, co); return carac.ActorID; }
public void MsgJoinConversationPlayer(Player player, bool newplayer) { PlayerCarac = player.Carac; ActorInfo = player.Info; Param2 = newplayer; MsgType = BBMsgType.JOIN_CONVERSATION; }
// Update PlayerInfo with info received from client public void UpdatePlayerInfo(ActorRTInfo info) { int id = info.Id; info.Id = id; GetPlayer(id).Info = info; }
public void MsgAddPlayer(Player player, bool newplayer) { PlayerCarac = player.Carac; ActorInfo = player.Info; Param2 = newplayer; MsgType = BBMsgType.ADD_PLAYER; }