public static Chat_Model_Base Parse(string str)
    {
        string roomId = str.Substring(40, 32);
        string result = str.Substring(72, 8);
        string type   = str.Substring(80, 8);
        string status = str.Substring(88, 8);
        string id     = str.Substring(96, 32);
        Chat_Model_BroadcastClanStatus_Response chat_Model_BroadcastClanStatus_Response = new Chat_Model_BroadcastClanStatus_Response();

        chat_Model_BroadcastClanStatus_Response.Id     = id;
        chat_Model_BroadcastClanStatus_Response.RoomId = roomId;
        chat_Model_BroadcastClanStatus_Response.Result = result;
        chat_Model_BroadcastClanStatus_Response.Type   = type;
        chat_Model_BroadcastClanStatus_Response.Status = status;
        Chat_Model_BroadcastClanStatus_Response chat_Model_BroadcastClanStatus_Response2 = chat_Model_BroadcastClanStatus_Response;

        chat_Model_BroadcastClanStatus_Response2.SetErrorType("0");
        return(chat_Model_BroadcastClanStatus_Response2);
    }
Ejemplo n.º 2
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());
        }
    }
    private void OnReceiveUpdateStatus(ChatPacket packet)
    {
        Chat_Model_BroadcastClanStatus_Response chat_Model_BroadcastClanStatus_Response = packet.model as Chat_Model_BroadcastClanStatus_Response;
        int result  = 0;
        int result2 = 0;
        int result3 = 0;
        int result4 = 0;
        int result5 = 0;

        int.TryParse(chat_Model_BroadcastClanStatus_Response.Type, out result);
        int.TryParse(chat_Model_BroadcastClanStatus_Response.RoomId, out result2);
        int.TryParse(chat_Model_BroadcastClanStatus_Response.Result, out result3);
        int.TryParse(chat_Model_BroadcastClanStatus_Response.Status, out result4);
        int.TryParse(chat_Model_BroadcastClanStatus_Response.Id, out result5);
        ClanUpdateStatusData clanUpdateStatusData = new ClanUpdateStatusData();

        clanUpdateStatusData.id     = result5;
        clanUpdateStatusData.type   = result;
        clanUpdateStatusData.roomId = result2;
        clanUpdateStatusData.result = result3;
        clanUpdateStatusData.status = result4;
        switch (result)
        {
        case 2:
            if (this.onReceiveUpdateStatus != null)
            {
                this.onReceiveUpdateStatus(clanUpdateStatusData);
            }
            break;

        case 3:
            if (this.onReceiveUpdateStatus != null)
            {
                this.onReceiveUpdateStatus(clanUpdateStatusData);
            }
            break;
        }
    }