コード例 #1
0
        private static void OnAskForAllianceRankingListMessageReceived(AskForAllianceRankingListMessage message, ServerSessionMessage requestMessage)
        {
            if (message.GetLocalRanking())
            {
                AllianceLocalRankingListMessage allianceLocalRankingListMessage = new AllianceLocalRankingListMessage();

                allianceLocalRankingListMessage.SetAllianceRankingList(new LogicArrayList <AllianceRankingEntry>(0));
                allianceLocalRankingListMessage.SetVillageType(message.GetVillageType());

                ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(allianceLocalRankingListMessage, requestMessage.SessionId),
                                                 ServerManager.GetProxySocket(requestMessage.SessionId));
            }
            else
            {
                AllianceRankingListMessage allianceRankingListMessage = new AllianceRankingListMessage();

                allianceRankingListMessage.SetAllianceRankingList(ScoringManager.GetAllianceRankingList(message.GetVillageType(), message.RemoveAllianceId()));
                allianceRankingListMessage.SetDiamondPrizes(ScoringManager.GetDiamondPrizes());
                allianceRankingListMessage.SetNextEndTimeSeconds(ScoringManager.GetNextEndTimeSeconds());
                allianceRankingListMessage.SetVillageType(message.GetVillageType());

                ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(allianceRankingListMessage, requestMessage.SessionId),
                                                 ServerManager.GetProxySocket(requestMessage.SessionId));
            }
        }
コード例 #2
0
        private static void OnAskForAvatarRankingListMessageReceived(AskForAvatarRankingListMessage message, ServerSessionMessage requestMessage)
        {
            if (message.GetVillageType() == 1)
            {
                AvatarDuelRankingListMessage avatarDuelRankingListMessage = new AvatarDuelRankingListMessage();
                LogicLong avatarId = message.RemoveAvatarId();

                avatarDuelRankingListMessage.SetAvatarRankingList(ScoringManager.GetAvatarDuelRankingList(avatarId));
                avatarDuelRankingListMessage.SetNextEndTimeSeconds(ScoringManager.GetNextEndTimeSeconds());
                avatarDuelRankingListMessage.SetSeasonMonth(ScoringManager.GetSeasonMonth());
                avatarDuelRankingListMessage.SetSeasonYear(ScoringManager.GetSeasonYear());
                avatarDuelRankingListMessage.SetLastSeasonAvatarRankingList(ScoringManager.GetLastSeasonAvatarDuelRankingList(avatarId));
                avatarDuelRankingListMessage.SetLastSeasonMonth(ScoringManager.GetLastSeasonMonth());
                avatarDuelRankingListMessage.SetLastSeasonYear(ScoringManager.GetLastSeasonYear());

                ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(avatarDuelRankingListMessage, requestMessage.SessionId),
                                                 ServerManager.GetProxySocket(requestMessage.SessionId));
            }
            else
            {
                AvatarRankingListMessage avatarRankingListMessage = new AvatarRankingListMessage();
                LogicLong avatarId = message.RemoveAvatarId();

                avatarRankingListMessage.SetAvatarRankingList(ScoringManager.GetAvatarRankingList(avatarId));
                avatarRankingListMessage.SetNextEndTimeSeconds(ScoringManager.GetNextEndTimeSeconds());
                avatarRankingListMessage.SetSeasonMonth(ScoringManager.GetSeasonMonth());
                avatarRankingListMessage.SetSeasonYear(ScoringManager.GetSeasonYear());
                avatarRankingListMessage.SetLastSeasonAvatarRankingList(ScoringManager.GetLastSeasonAvatarRankingList(avatarId));
                avatarRankingListMessage.SetLastSeasonMonth(ScoringManager.GetLastSeasonMonth());
                avatarRankingListMessage.SetLastSeasonYear(ScoringManager.GetLastSeasonYear());

                ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(avatarRankingListMessage, requestMessage.SessionId),
                                                 ServerManager.GetProxySocket(requestMessage.SessionId));
            }
        }
コード例 #3
0
        private static void OnAskForLocalAvatarRankingListMessageReceived(AskForAvatarLocalRankingListMessage message, ServerSessionMessage requestMessage)
        {
            AvatarLocalRankingListMessage avatarLocalRankingListMessage = new AvatarLocalRankingListMessage();

            avatarLocalRankingListMessage.SetAvatarRankingList(new LogicArrayList <AvatarRankingEntry>(0));
            ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(avatarLocalRankingListMessage, requestMessage.SessionId),
                                             ServerManager.GetProxySocket(requestMessage.SessionId));
        }
コード例 #4
0
 public override void OnReceiveSessionMessage(ServerSessionMessage message)
 {
     switch (message.GetMessageType())
     {
     case ServerMessageType.FORWARD_LOGIC_REQUEST_MESSAGE:
         ScoringMessageManager.OnForwardLogicRequestMessageReceived((ForwardLogicRequestMessage)message);
         break;
     }
 }
コード例 #5
0
        private static void OnAskForAvatarDuelLastSeasonRankingListMessageReceived(AskForAvatarDuelLastSeasonRankingListMessage message, ServerSessionMessage requestMessage)
        {
            AvatarDuelLastSeasonRankingListMessage avatarDuelLastSeasonRankingListMessage = new AvatarDuelLastSeasonRankingListMessage();

            avatarDuelLastSeasonRankingListMessage.SetAvatarRankingList(ScoringManager.GetLastSeasonAvatarDuelRankingList(message.RemoveAvatarId()));
            avatarDuelLastSeasonRankingListMessage.SetSeasonYear(ScoringManager.GetLastSeasonYear());
            avatarDuelLastSeasonRankingListMessage.SetSeasonMonth(ScoringManager.GetLastSeasonMonth());
            ServerMessageManager.SendMessage(ScoringMessageManager.CreateForwardLogicMessage(avatarDuelLastSeasonRankingListMessage, requestMessage.SessionId),
                                             ServerManager.GetProxySocket(requestMessage.SessionId));
        }
コード例 #6
0
        private static void OnForwardLogicRequestMessageReceived(ForwardLogicRequestMessage message)
        {
            PiranhaMessage logicMessage = LogicMagicMessageFactory.Instance.CreateMessageByType(message.MessageType);

            if (logicMessage == null)
            {
                throw new Exception("logicMessage should not be NULL!");
            }

            logicMessage.GetByteStream().SetByteArray(message.MessageBytes, message.MessageLength);
            logicMessage.SetMessageVersion(message.MessageVersion);
            logicMessage.Decode();

            if (!logicMessage.IsServerToClientMessage())
            {
                switch (logicMessage.GetMessageType())
                {
                case AskForAllianceRankingListMessage.MESSAGE_TYPE:
                    ScoringMessageManager.OnAskForAllianceRankingListMessageReceived((AskForAllianceRankingListMessage)logicMessage, message);
                    break;

                case AskForAvatarRankingListMessage.MESSAGE_TYPE:
                    ScoringMessageManager.OnAskForAvatarRankingListMessageReceived((AskForAvatarRankingListMessage)logicMessage, message);
                    break;

                case AskForAvatarLocalRankingListMessage.MESSAGE_TYPE:
                    ScoringMessageManager.OnAskForLocalAvatarRankingListMessageReceived((AskForAvatarLocalRankingListMessage)logicMessage, message);
                    break;

                case AskForAvatarLastSeasonRankingListMessage.MESSAGE_TYPE:
                    ScoringMessageManager.OnAskForAvatarLastSeasonRankingListMessageReceived((AskForAvatarLastSeasonRankingListMessage)logicMessage, message);
                    break;

                case AskForAvatarDuelLastSeasonRankingListMessage.MESSAGE_TYPE:
                    ScoringMessageManager.OnAskForAvatarDuelLastSeasonRankingListMessageReceived((AskForAvatarDuelLastSeasonRankingListMessage)logicMessage, message);
                    break;
                }
            }
        }