Esempio n. 1
0
    public static Chat_Model_Base Parse(string str)
    {
        Chat_Model_UpdateDarkMarket chat_Model_UpdateDarkMarket = new Chat_Model_UpdateDarkMarket();

        chat_Model_UpdateDarkMarket.m_packetType = CHAT_PACKET_TYPE.DARK_MARKET_UPDATE;
        chat_Model_UpdateDarkMarket.payload      = str.Substring(Chat_Model_Base.PAYLOAD_ORIGIN_INDEX);
        chat_Model_UpdateDarkMarket.itemMarketId = str.Substring(40, 10);
        chat_Model_UpdateDarkMarket.soldNum      = str.Substring(50, 10);
        Chat_Model_UpdateDarkMarket chat_Model_UpdateDarkMarket2 = chat_Model_UpdateDarkMarket;

        chat_Model_UpdateDarkMarket2.SetErrorType("0");
        return(chat_Model_UpdateDarkMarket2);
    }
Esempio n. 2
0
    private void OnReceiveUpdateDarkMarket(Chat_Model_UpdateDarkMarket packet)
    {
        int result = 0;

        int.TryParse(packet.itemMarketId, out result);
        int result2 = 0;

        int.TryParse(packet.soldNum, out result2);
        if (result != 0 && result2 != 0)
        {
            MonoBehaviourSingleton <ShopManager> .I.UpdateDarkMarketUsedCount(result, result2);
        }
        MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_DARK_MARKET);
    }
    public static Chat_Model_Base ParseModel(string str, CHAT_PACKET_TYPE type)
    {
        switch (type)
        {
        case CHAT_PACKET_TYPE.JOIN_ROOM:
            return(Chat_Model_JoinRoom.Parse(str));

        case CHAT_PACKET_TYPE.BROADCAST_ROOM:
            return(Chat_Model_BroadcastMessage_Response.Parse(str));

        case CHAT_PACKET_TYPE.PARTY_INVITE:
            return(Chat_Model_PartyInvite.Parse(str));

        case CHAT_PACKET_TYPE.CLAN_JOIN_ROOM:
            return(Chat_Model_JoinClanRoom.Parse(str));

        case CHAT_PACKET_TYPE.CLAN_LEAVE_ROOM:
            return(Chat_Model_LeaveClanRoom.Parse(str));

        case CHAT_PACKET_TYPE.CLAN_SENDTO:
            return(Chat_Model_SendToClanMessage_Response.Parse(str));

        case CHAT_PACKET_TYPE.CLAN_BROADCAST_ROOM:
            return(Chat_Model_BroadcastClanMessage_Response.Parse(str));

        case CHAT_PACKET_TYPE.CLAN_BROADCAST_STATUS:
            return(Chat_Model_BroadcastClanStatus_Response.Parse(str));

        case CHAT_PACKET_TYPE.RALLY_INVITE:
            return(Chat_Model_RallyInvite.Parse(str));

        case CHAT_PACKET_TYPE.DARK_MARKET_RESET:
            return(Chat_Model_ResetDarkMarket.Parse(str));

        case CHAT_PACKET_TYPE.DARK_MARKET_UPDATE:
            return(Chat_Model_UpdateDarkMarket.Parse(str));

        default:
            return(new Chat_Model_Base());
        }
    }
Esempio n. 4
0
    private void OnReceivePacket(ChatPacket packet)
    {
        if (packet != null)
        {
            switch (packet.model.packetType)
            {
            case CHAT_PACKET_TYPE.JOIN_ROOM:
                OnJoin(packet);
                break;

            case CHAT_PACKET_TYPE.BROADCAST_ROOM:
            {
                Chat_Model_BroadcastMessage_Response chat_Model_BroadcastMessage_Response = packet.model as Chat_Model_BroadcastMessage_Response;
                if (chat_Model_BroadcastMessage_Response != null)
                {
                    OnReceiveMessage(chat_Model_BroadcastMessage_Response);
                }
                else
                {
                    Log.Error("Failed parse: Chat_Model_BroadCastMessage_Response");
                }
                break;
            }

            case CHAT_PACKET_TYPE.PARTY_INVITE:
            {
                Chat_Model_PartyInvite chat_Model_PartyInvite = packet.model as Chat_Model_PartyInvite;
                if (chat_Model_PartyInvite != null)
                {
                    OnReceivePartyInvite(chat_Model_PartyInvite);
                }
                else
                {
                    Log.Error("Failed parse: Chat_Model_BroadCastMessage_Response");
                }
                break;
            }

            case CHAT_PACKET_TYPE.RALLY_INVITE:
            {
                Chat_Model_RallyInvite chat_Model_RallyInvite = packet.model as Chat_Model_RallyInvite;
                if (chat_Model_RallyInvite != null)
                {
                    OnReceiveRallyInvite(chat_Model_RallyInvite);
                }
                else
                {
                    Log.Error("Failed parse: Chat_Model_RallyInvite");
                }
                break;
            }

            case CHAT_PACKET_TYPE.DARK_MARKET_RESET:
            {
                Chat_Model_ResetDarkMarket chat_Model_ResetDarkMarket = packet.model as Chat_Model_ResetDarkMarket;
                if (chat_Model_ResetDarkMarket != null)
                {
                    OnReceiveResetDarkMarket(chat_Model_ResetDarkMarket);
                }
                else
                {
                    Log.Error("Failed parse: Chat_Model_ResetDarkMarket");
                }
                break;
            }

            case CHAT_PACKET_TYPE.DARK_MARKET_UPDATE:
            {
                Chat_Model_UpdateDarkMarket chat_Model_UpdateDarkMarket = packet.model as Chat_Model_UpdateDarkMarket;
                if (chat_Model_UpdateDarkMarket != null)
                {
                    OnReceiveUpdateDarkMarket(chat_Model_UpdateDarkMarket);
                }
                else
                {
                    Log.Error("Failed parse: Chat_Model_UpdateDarkMarket");
                }
                break;
            }
            }
        }
    }