Ejemplo n.º 1
0
    public static Chat_Model_PartyInvite Create(string flag)
    {
        Chat_Model_PartyInvite chat_Model_PartyInvite = new Chat_Model_PartyInvite();

        chat_Model_PartyInvite.flag = flag;
        Chat_Model_PartyInvite chat_Model_PartyInvite2 = chat_Model_PartyInvite;

        chat_Model_PartyInvite2.payload = chat_Model_PartyInvite2.Serialize();
        return(chat_Model_PartyInvite2);
    }
Ejemplo n.º 2
0
    public static Chat_Model_Base Parse(string str)
    {
        Chat_Model_PartyInvite chat_Model_PartyInvite = new Chat_Model_PartyInvite();

        chat_Model_PartyInvite.m_packetType = CHAT_PACKET_TYPE.PARTY_INVITE;
        chat_Model_PartyInvite.payload      = str.Substring(Chat_Model_Base.PAYLOAD_ORIGIN_INDEX);
        chat_Model_PartyInvite.flag         = str.Substring(40, 1);
        Chat_Model_PartyInvite chat_Model_PartyInvite2 = chat_Model_PartyInvite;

        chat_Model_PartyInvite2.SetErrorType("0");
        return(chat_Model_PartyInvite2);
    }
Ejemplo n.º 3
0
    private void OnReceivePartyInvite(Chat_Model_PartyInvite packet)
    {
        int result = 0;

        int.TryParse(packet.flag, out result);
        if (result > 0)
        {
            if (MonoBehaviourSingleton <UserInfoManager> .IsValid())
            {
                MonoBehaviourSingleton <UserInfoManager> .I.SetPartyInviteChat(true);
            }
        }
        else if (MonoBehaviourSingleton <UserInfoManager> .IsValid())
        {
            MonoBehaviourSingleton <UserInfoManager> .I.SetPartyInviteChat(false);
        }
    }
Ejemplo n.º 4
0
    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());
        }
    }
Ejemplo n.º 5
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;
            }
            }
        }
    }