public static Chat_Model_Base Parse(string str) { Chat_Model_ResetDarkMarket chat_Model_ResetDarkMarket = new Chat_Model_ResetDarkMarket(); chat_Model_ResetDarkMarket.m_packetType = CHAT_PACKET_TYPE.DARK_MARKET_RESET; chat_Model_ResetDarkMarket.payload = str.Substring(Chat_Model_Base.PAYLOAD_ORIGIN_INDEX); chat_Model_ResetDarkMarket.endDate = str.Substring(40, 14); Chat_Model_ResetDarkMarket chat_Model_ResetDarkMarket2 = chat_Model_ResetDarkMarket; chat_Model_ResetDarkMarket2.SetErrorType("0"); return(chat_Model_ResetDarkMarket2); }
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 OnReceiveResetDarkMarket(Chat_Model_ResetDarkMarket packet) { GameSaveData.instance.resetMarketTime = $"{packet.endDate.Substring(0, 4)}-{packet.endDate.Substring(4, 2)}-{packet.endDate.Substring(6, 2)} {packet.endDate.Substring(8, 2)}:{packet.endDate.Substring(10, 2)}:{packet.endDate.Substring(12, 2)}"; MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.RESET_DARK_MARKET); }
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; } } } }