public static void SendMessage(Arena arena, Player player) { RawMessage message = PrepareMessageFor(typeof(OM_PlayerWalk)); message.putInt("playerId", player.id); message.putFloat("walkSpeed", player.walkSpeed); message.PutVector3("walkTarget", player.walkTarget); message.PutVector3("currentPosition", player.position); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Player skillUser, FireballMissile spawned) { RawMessage message = PrepareMessageFor(typeof(OM_FireballSkillUsed)); message.putInt("playerId", skillUser.id); message.putInt("missileId", spawned.id); message.PutVector3("position", spawned.position); message.PutVector3("direction", spawned.movementDirection); foreach (var player in arena.players) { player.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Missile missile) { RawMessage message = PrepareMessageFor(typeof(OM_CreateMissile)); message.putInt("missileTypeId", TypeIdGenerator.idsOfMissiles[missile.GetType()]); message.putInt("missileId", missile.id); message.PutVector3("position", missile.position); message.PutVector3("direction", missile.movementDirection); foreach (var player in arena.players) { player.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena) { RawMessage message = PrepareMessageFor(typeof(OM_LoadingNextRoundStarted)); AddLandInfo(message, arena); AddObstacleInfo(message, arena); List <RawMessage> playerInfos = new List <RawMessage>(arena.players.Count); foreach (var p in arena.players) { RawMessage pMes = new RawMessage(); pMes.putInt("pId", p.id); pMes.PutVector3("pos", p.position); int[] skillTypeIds = new int[p.skills.Count]; for (int i = 0; i < skillTypeIds.Length; i++) { skillTypeIds[i] = TypeIdGenerator.idsOfSkills[p.skills[i].GetType()]; } pMes.putIntArray("skillTypeIds", skillTypeIds); playerInfos.Add(pMes); } message.putRawMessageArray("playerInfos", playerInfos.ToArray()); foreach (var player in arena.players) { player.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Missile missile) { RawMessage message = PrepareMessageFor(typeof(OM_MissileExplode)); message.putInt("missileId", missile.id); message.PutVector3("explosionPosition", missile.position); foreach (var player in arena.players) { player.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Player player) { RawMessage message = PrepareMessageFor(typeof(OM_TeleportSkillUsed)); message.putInt("playerId", player.id); message.PutVector3("newPosition", player.position); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Obstacle obstacle, Vector3 impactPosition) { RawMessage message = PrepareMessageFor(typeof(OM_ObstacleHealthInfo)); message.putInt("obstacleId", obstacle.id); message.putFloat("health", obstacle.health); message.PutVector3("impactPosition", impactPosition); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, Player player) { RawMessage message = PrepareMessageFor(typeof(OM_PlayerFly)); message.putInt("playerId", player.id); message.putFloat("flySpeed", player.flySpeed); message.PutVector3("flyTarget", player.flyTarget); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }