public static void sendMessage(Type nodeType) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId( typeof(LUnlockNodeRequest) )); msg.putInt("tid",TypeIdGenerator.getScienceNodeIds (nodeType)); Network.server.SendMessage(msg); }
public static void sendMessage(ICollection <Player> receiverPlayers, Minion minion, ICollection <Minion> otherMinions) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_QuantumSoldier_teleport))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putFloat("ds", 1.3f); int [] minionInstanceIDs = new int[otherMinions.Count]; int index = 0; foreach (var minionTarget in otherMinions) { minionInstanceIDs[index++] = minionTarget.instanceId; } msg.putIntArray("mids", minionInstanceIDs); foreach (var receiverPlayer in receiverPlayers) { receiverPlayer.user.session.client.SendMessage(msg); } } }
public static void sendMessage(ICollection <Player> receiverPlayers, Tower tower, ICollection <Minion> minionsToTeleport) { if (receiverPlayers != null && receiverPlayers.Count != 0) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GTower_BlackHole_teleport))); msg.putInt("iid", tower.instanceId); int[] ids = new int[minionsToTeleport.Count]; int index = 0; foreach (var minion in minionsToTeleport) { ids[index++] = minion.instanceId; } msg.putIntArray("miid", ids); foreach (var receiverPlayer in receiverPlayers) { receiverPlayer.user.session.client.SendMessage(msg); } } }
public static void sendMessage(ICollection <Player> receiverPlayers, MutantEightLeggedMinion parentMinion, ICollection <MutantEightLeggedSpawningMinion> spawnedMinions, ICollection <Minion> deadMinions) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_MutantEightLegged_spawn))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", parentMinion.instanceId); msg.putInt("c", spawnedMinions.Count); int[] sid = new int[spawnedMinions.Count]; for (int i = 0; i < spawnedMinions.Count; i++) { sid[i] = spawnedMinions.ElementAt(i).instanceId; } msg.putIntArray("sid", sid); int[] did = new int[deadMinions.Count]; for (int i = 0; i < deadMinions.Count; i++) { did[i] = deadMinions.ElementAt(i).instanceId; } msg.putIntArray("did", did); foreach (var receiverPlayer in receiverPlayers) { receiverPlayer.user.session.client.SendMessage(msg); } } }
static public void sendMessage( int minionTypeId) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GCreateMinionRequest))); msg.putInt("tid", minionTypeId); Network.server.SendMessage(msg); }
public static void sendMessage(Type nodeType) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LUnlockNodeRequest))); msg.putInt("tid", TypeIdGenerator.getScienceNodeIds(nodeType)); Network.server.SendMessage(msg); }
static public void sendMessage(int minionTypeId) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GCreateMinionRequest))); msg.putInt("tid", minionTypeId); Network.server.SendMessage(msg); }
static public void sendMessage(int towerTypeId, int indexOnBoard) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GCreateTowerRequest))); msg.putInt("tid", towerTypeId); msg.putInt("iob", indexOnBoard); Network.server.SendMessage(msg); }
static public void sendMessage(Engine.Towers.Tower tower, int upgradedTowerTypeId) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GUpgradeTowerRequest))); msg.putInt("tid", upgradedTowerTypeId); msg.putInt("iob", tower.indexOnBoard); Network.server.SendMessage(msg); }
public static void SendMessage(Player player, int skillTypeId, int skillSlotIndex) { RawMessage message = PrepareMessageFor(typeof(OM_SkillUnlocked)); message.putInt("skillTypeId", skillTypeId); message.putInt("slotIndex", skillSlotIndex); player.user.client.SendMessage(message); }
static public void sendMessage(int currentMinionTypeId, int upgradedMinionTypeId) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GUpgradeMinionRequest))); msg.putInt("tid", currentMinionTypeId); msg.putInt("utid", upgradedMinionTypeId); Network.server.SendMessage(msg); }
public static void sendMessage(Player player) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GCashAndIncomeInfo))); msg.putInt("c", player.cash); msg.putInt("i", player.income); player.user.session.client.SendMessage(msg); }
public static void SendMessage(Arena arena, int blockIndexI, int blockIndexJ) { RawMessage message = PrepareMessageFor(typeof(OM_BlockDestroyed)); message.putInt("indexI", blockIndexI); message.putInt("indexJ", blockIndexJ); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void SendMessage(Arena arena, float duration) { RawMessage message = PrepareMessageFor(typeof(OM_StartCountdown)); message.putFloat("duration", duration); message.putInt("round", arena.currentRound); message.putInt("totalRounds", arena.totalRounds); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_Zombie_Raise))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(Player receiverPlayer, int oldMinionTypeId, int upgradedMinionTypeId) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GUpgradeMinionResult))); if (receiverPlayer != null) { msg.putInt("tid", oldMinionTypeId); msg.putInt("utid", upgradedMinionTypeId); receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, Tower tower) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GDestroyTowerInfo))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("bid", tower.board.instanceId); msg.putInt("iob", tower.indexOnBoard); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion, MinionEffect effect) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAddEffectOnMinion))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putInt("tid", TypeIdGenerator.getMinionEffectId(effect.GetType())); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion, float runBackTime) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_Trypanophobia_addEffect))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putFloat("t", runBackTime); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, FrankenScientistMinion minion, int stackCount) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_FrankenScientist_stackChanged))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putInt("c", stackCount); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, Player player) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GPlayerHealthInfo))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("h", player.healthPoints); msg.putInt("uid", player.user.id); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
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(ICollection<Player> receiverPlayers, LaserTower tower, Minion targetedMinion) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GTower_LaserTower_untarget))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("tiob", tower.indexOnBoard); msg.putInt("tbid", tower.board.instanceId); msg.putInt("miid", targetedMinion.instanceId); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
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(ICollection<Player> recievers , StatTracker statTracker) { RawMessage bigMsg = new RawMessage(); bigMsg.putInt("id", TypeIdGenerator.getMessageId(typeof(GEndGameStatisticsResult))); bigMsg.putInt("c",statTracker.playerStatsList.Count); int[] playerIDs = new int[statTracker.playerStatsList.Count]; int [] minionsKilled = new int[statTracker.playerStatsList.Count]; int[] minionsSend = new int[statTracker.playerStatsList.Count]; int[] towersBuilt = new int[statTracker.playerStatsList.Count]; int[] missilesFired = new int[statTracker.playerStatsList.Count]; int[] minionsPassed = new int[statTracker.playerStatsList.Count]; float[] moneyEarned = new float[statTracker.playerStatsList.Count]; float[] moneySpend = new float[statTracker.playerStatsList.Count]; int[] cashs = new int[statTracker.playerStatsList.Count]; int[] incomes = new int[statTracker.playerStatsList.Count]; for(int i = 0; i < statTracker.playerStatsList.Count; i++) { playerIDs[i] = statTracker.playerStatsList[i].ownerPlayer.id; minionsKilled[i] = statTracker.playerStatsList[i].minionsKilled; minionsSend[i] = statTracker.playerStatsList[i].minionsSend; towersBuilt[i] = statTracker.playerStatsList[i].towersBuilt; missilesFired[i] = statTracker.playerStatsList[i].missilesFired; minionsPassed[i] = statTracker.playerStatsList[i].minionsPassed; moneyEarned[i] = statTracker.playerStatsList[i].moneyEarned; moneySpend[i] = statTracker.playerStatsList[i].moneySpend; cashs[i] = statTracker.playerStatsList[i].cash; incomes[i] = statTracker.playerStatsList[i].income; } bigMsg.putIntArray("pids", playerIDs); bigMsg.putIntArray("mk",minionsKilled); bigMsg.putIntArray("ms", minionsSend); bigMsg.putIntArray("tb", towersBuilt); bigMsg.putIntArray("mf", missilesFired); bigMsg.putIntArray("mp", minionsPassed); bigMsg.putFloatArray("mme", moneyEarned); bigMsg.putFloatArray("mms", moneySpend); bigMsg.putIntArray("cs", cashs); bigMsg.putIntArray("inc",incomes); foreach (Player p in recievers) { p.user.session.client.SendMessage(bigMsg); } }
public static void sendMessage(ICollection <Player> recievers, StatTracker statTracker) { RawMessage bigMsg = new RawMessage(); bigMsg.putInt("id", TypeIdGenerator.getMessageId(typeof(GEndGameStatisticsResult))); bigMsg.putInt("c", statTracker.playerStatsList.Count); int[] playerIDs = new int[statTracker.playerStatsList.Count]; int [] minionsKilled = new int[statTracker.playerStatsList.Count]; int[] minionsSend = new int[statTracker.playerStatsList.Count]; int[] towersBuilt = new int[statTracker.playerStatsList.Count]; int[] missilesFired = new int[statTracker.playerStatsList.Count]; int[] minionsPassed = new int[statTracker.playerStatsList.Count]; float[] moneyEarned = new float[statTracker.playerStatsList.Count]; float[] moneySpend = new float[statTracker.playerStatsList.Count]; int[] cashs = new int[statTracker.playerStatsList.Count]; int[] incomes = new int[statTracker.playerStatsList.Count]; for (int i = 0; i < statTracker.playerStatsList.Count; i++) { playerIDs[i] = statTracker.playerStatsList[i].ownerPlayer.id; minionsKilled[i] = statTracker.playerStatsList[i].minionsKilled; minionsSend[i] = statTracker.playerStatsList[i].minionsSend; towersBuilt[i] = statTracker.playerStatsList[i].towersBuilt; missilesFired[i] = statTracker.playerStatsList[i].missilesFired; minionsPassed[i] = statTracker.playerStatsList[i].minionsPassed; moneyEarned[i] = statTracker.playerStatsList[i].moneyEarned; moneySpend[i] = statTracker.playerStatsList[i].moneySpend; cashs[i] = statTracker.playerStatsList[i].cash; incomes[i] = statTracker.playerStatsList[i].income; } bigMsg.putIntArray("pids", playerIDs); bigMsg.putIntArray("mk", minionsKilled); bigMsg.putIntArray("ms", minionsSend); bigMsg.putIntArray("tb", towersBuilt); bigMsg.putIntArray("mf", missilesFired); bigMsg.putIntArray("mp", minionsPassed); bigMsg.putFloatArray("mme", moneyEarned); bigMsg.putFloatArray("mms", moneySpend); bigMsg.putIntArray("cs", cashs); bigMsg.putIntArray("inc", incomes); foreach (Player p in recievers) { p.user.session.client.SendMessage(bigMsg); } }
public static void sendMessage(string scienceType) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId( typeof(LEnterQueueRequest) )); msg.putUTF8String("st",scienceType); Network.server.SendMessage(msg); }
public static void SendMessage(Arena arena) { RawMessage message = PrepareMessageFor(typeof(OM_RoundOver)); int[] deathOrder = new int[arena.roundStats.deathOrder.Count]; int[] finalScores = arena.roundStats.finalGolds; List <Player> deathOrderList = arena.roundStats.deathOrder; for (int i = 0; i < arena.roundStats.deathOrder.Count; i++) { deathOrder[i] = deathOrderList[i].id; } message.putInt("winnerCount", arena.roundStats.winnerCount); message.putIntArray("deathOrder", deathOrder); message.putIntArray("finals", finalScores); message.putIntArray("kills", arena.roundStats.kills); message.putIntArray("hits", arena.roundStats.hits); foreach (var p in arena.players) { p.user.client.SendMessage(message); } }
public static void sendMessage(ICollection<Player> recievers) { RawMessage bigMsg = new RawMessage(); bigMsg.putInt("id", TypeIdGenerator.getMessageId(typeof(GLoadingStateRequest))); List<RawMessage> userMsgs = new List<RawMessage>(); foreach (Player player in recievers) { RawMessage msg = new RawMessage(); msg.putInt("btid", TypeIdGenerator.getBoardId(player.board.GetType())); msg.putInt("biid", player.board.instanceId); msg.putUTF8String("st", player.user.selectedScienceTypeInQueue.ToString()); msg.putInt("hps", player.healthPoints); msg.putInt("cash", player.cash); msg.putInt("inc", player.income); msg.putUTF8String("un", player.user.username); msg.putInt("uid", player.user.id); userMsgs.Add(msg); } bigMsg.putRawMessageArray("users", userMsgs.ToArray()); foreach (Player p in recievers) { p.user.session.client.SendMessage(bigMsg); } }
public static void sendMessage(ICollection <Player> recievers) { RawMessage bigMsg = new RawMessage(); bigMsg.putInt("id", TypeIdGenerator.getMessageId(typeof(GLoadingStateRequest))); List <RawMessage> userMsgs = new List <RawMessage>(); foreach (Player player in recievers) { RawMessage msg = new RawMessage(); msg.putInt("btid", TypeIdGenerator.getBoardId(player.board.GetType())); msg.putInt("biid", player.board.instanceId); msg.putUTF8String("st", player.user.selectedScienceTypeInQueue.ToString()); msg.putInt("hps", player.healthPoints); msg.putInt("cash", player.cash); msg.putInt("inc", player.income); msg.putUTF8String("un", player.user.username); msg.putInt("uid", player.user.id); userMsgs.Add(msg); } bigMsg.putRawMessageArray("users", userMsgs.ToArray()); foreach (Player p in recievers) { p.user.session.client.SendMessage(bigMsg); } }
protected static RawMessage PrepareMessageFor(Type messageType) { RawMessage message = new RawMessage(); message.putInt("messageTypeId", TypeIdGenerator.outgoingMessageIds[messageType]); return(message); }
public static void sendMessage(ICollection <Player> receiverPlayers, Minion minion) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_Zombie_Raise))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); foreach (var receiverPlayer in receiverPlayers) { receiverPlayer.user.session.client.SendMessage(msg); } } }
public static void sendMessage() { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LCancelQueueRequest))); Network.server.SendMessage(msg); }
public static void sendMessage() { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GEndGameStatisticsRequest))); Network.server.SendMessage(msg); }
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(User receiver, bool result) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LoginResult))); msg.putBool("r", result); msg.putUTF8String("un", receiver.username); msg.putInt("ui", receiver.id); msg.putInt("psp", receiver.physicsSciencePoint); msg.putInt("csp", receiver.chemistrySciencePoint); msg.putInt("bsp", receiver.biologySciencePoint); msg.putBoolArray("usn", receiver.unlockedScienceNodes); receiver.session.client.SendMessage(msg); }
public static void sendMessage(bool result) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GReadyStateResult))); msg.putBool("r", result); Network.server.SendMessage(msg); }
public static void sendMessage() { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GLoadingStateResult))); Network.server.SendMessage(msg); }
public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinionPositionInfo))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putInt("bid", minion.position.board.instanceId); msg.putInt("cid", minion.position.pathPosition.pointIndex); msg.putFloat("t", minion.position.pathPosition.ratio); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage() { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GQuitGameRequest))); Network.server.SendMessage(msg); Runner.Graphics.destroyGame(); }
public static void sendMessage(ICollection <Player> receiverPlayers, Minion minion, MinionEffect effect) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAddEffectOnMinion))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", minion.instanceId); msg.putInt("tid", TypeIdGenerator.getMinionEffectId(effect.GetType())); foreach (var receiverPlayer in receiverPlayers) { receiverPlayer.user.session.client.SendMessage(msg); } } }
public static void sendMessage(User receiver) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(EnterLobby))); receiver.session.client.SendMessage(msg); }
public static void sendMessage(string text) { // TODO User state check RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId( typeof(LChatMessage) )); msg.putUTF8String("cmd", text); Network.server.SendMessage(msg); }
public static void SendMessage(Player player) { RawMessage message = PrepareMessageFor(typeof(OM_PlayerGoldInfo)); message.putInt("gold", player.gold); player.user.client.SendMessage(message); }
public static void sendMessage(User user) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LReturnQueue))); user.userState = User.UserState.LOBBY; Runner.queue.addUser(user); user.session.client.SendMessage(msg); }
public static void sendMessage(User receiver) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId( typeof(EnterLobby)) ); receiver.session.client.SendMessage(msg); }
public static void sendMessage(User user, bool result) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LCancelQueueResult))); msg.putBool("r", result); user.session.client.SendMessage(msg); }
public static void sendMessage( ICollection<Player> receiverPlayers, float seconds) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GEnterStartCountdown))); msg.putFloat("s", seconds); foreach (var player in receiverPlayers) player.user.session.client.SendMessage(msg); }
public static void sendMessage(ICollection<Player> receiverPlayers, SeedTowerPlantMissile missile) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAreaEffect_SeedTowerAreaEffect_createMissile))); if (receiverPlayers != null && receiverPlayers.Count != 0) { msg.putInt("iid", missile.instanceId); msg.putFloat("x", missile.startWorldPosition.x); msg.putFloat("y", missile.startWorldPosition.y); msg.putFloat("z", missile.startWorldPosition.z); msg.putInt("tid", TypeIdGenerator.getMissileId(missile.GetType())); msg.putInt("mid", missile.targetMinion.instanceId); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(ICollection<Player> receiverPlayers, AreaEffect areaEffect) { if (receiverPlayers != null && receiverPlayers.Count != 0) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAddAreaEffect))); msg.putInt("iid", areaEffect.instanceId); msg.putInt("tid", TypeIdGenerator.getAreaEffectId(areaEffect.GetType())); msg.putInt("uid", areaEffect.ownerPlayer.user.id); Vector3 position = areaEffect.getWorldPosition(); msg.putFloatArray("pos", new float[] { position.x, position.y, position.z }); foreach (var receiverPlayer in receiverPlayers) receiverPlayer.user.session.client.SendMessage(msg); } }
public static void sendMessage(string senderUsername,string message) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LChatMessage)) ); msg.putUTF8String("s", senderUsername); msg.putUTF8String("m", message); foreach (User u in Runner.users.Where( p => p.userState == User.UserState.LOBBY || p.userState == User.UserState.QUEUE )) u.session.client.SendMessage(msg); }
public static void sendMessage(User user, string message) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GChatMessage))); msg.putUTF8String("s", user.username); msg.putUTF8String("m", message); foreach (Player p in user.player.game.players) p.user.session.client.SendMessage(msg); }
public static void sendMessage(ICollection<Player> recievers) { RawMessage msg = new RawMessage(); msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GReadyStateRequest))); msg.putFloat("s", Science_Wars_Server.Game.READY_STATE_END_TIME_DEFAULT); foreach (Player p in recievers) p.user.session.client.SendMessage(msg); }