예제 #1
0
		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);
		}
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        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);
                }
            }
        }
예제 #5
0
		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);
		}
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
 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);
 }
예제 #9
0
 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);
 }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
        }
예제 #16
0
        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);
            }
        }
예제 #17
0
        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);
            }
        }
예제 #18
0
        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);
            }
        }
예제 #19
0
        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);
            }
        }
예제 #20
0
        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);
            }
        }
예제 #21
0
        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);
            }
        }
예제 #24
0
        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);
            }
        }
예제 #25
0
        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);
            }
        }
예제 #26
0
        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);
            }
        }
예제 #28
0
        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);
            }
        }
예제 #30
0
        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);
            }
        }
예제 #31
0
		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);
		}
예제 #32
0
        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);
            }
        }
예제 #33
0
        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);

            }
        }
예제 #34
0
        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);
            }
        }
예제 #35
0
        protected static RawMessage PrepareMessageFor(Type messageType)
        {
            RawMessage message = new RawMessage();

            message.putInt("messageTypeId", TypeIdGenerator.outgoingMessageIds[messageType]);
            return(message);
        }
예제 #36
0
        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);
                }
            }
        }
예제 #37
0
        public static void sendMessage()
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(LCancelQueueRequest)));
            Network.server.SendMessage(msg);
        }
예제 #38
0
        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);
            }
        }
예제 #40
0
        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);
        }
예제 #41
0
 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);
 }
예제 #42
0
        public static void sendMessage()
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GLoadingStateResult)));
            Network.server.SendMessage(msg);
        }
예제 #43
0
        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);
            }
        }
예제 #44
0
        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);
        }
예제 #45
0
 public static void sendMessage()
 {
     RawMessage msg = new RawMessage();
     msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GQuitGameRequest)));
     Network.server.SendMessage(msg);
     Runner.Graphics.destroyGame();
     
 }
예제 #46
0
        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);
                }
            }
        }
예제 #47
0
        public static void sendMessage(User receiver)
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(EnterLobby)));

            receiver.session.client.SendMessage(msg);
        }
예제 #48
0
 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);
 }
예제 #49
0
        public static void SendMessage(Player player)
        {
            RawMessage message = PrepareMessageFor(typeof(OM_PlayerGoldInfo));

            message.putInt("gold", player.gold);

            player.user.client.SendMessage(message);
        }
예제 #50
0
 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);
 }
예제 #51
0
        public static void sendMessage(User receiver)
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId( typeof(EnterLobby)) );

            receiver.session.client.SendMessage(msg);
        }
예제 #52
0
        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);
        }
예제 #53
0
        public static void sendMessage()
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GQuitGameRequest)));
            Network.server.SendMessage(msg);
            Runner.Graphics.destroyGame();
        }
예제 #54
0
        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);
            }
        }
예제 #56
0
        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);
            }
        }
예제 #57
0
        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);
        }
예제 #58
0
        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);
        }
예제 #59
0
        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);
        }