From 09e90a8c932bf26cd70d4217ab87d3e4a5de893b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 19 Jun 2021 21:11:45 -0500 Subject: [PATCH] cleaned RoomSessionChatEvent --- .../session/events/RoomSessionChatEvent.ts | 24 +++++++++---------- src/nitro/session/handler/RoomChatHandler.ts | 12 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nitro/session/events/RoomSessionChatEvent.ts b/src/nitro/session/events/RoomSessionChatEvent.ts index 3254262f..d9214e04 100644 --- a/src/nitro/session/events/RoomSessionChatEvent.ts +++ b/src/nitro/session/events/RoomSessionChatEvent.ts @@ -6,17 +6,17 @@ export class RoomSessionChatEvent extends RoomSessionEvent public static CHAT_EVENT: string = 'RSCE_CHAT_EVENT'; public static FLOOD_EVENT: string = 'RSCE_FLOOD_EVENT'; - public static CHAT_NORMAL: number = 0; - public static CHAT_WHISPER: number = 1; - public static CHAT_SHOUT: number = 2; - public static _Str_5821: number = 3; - public static _Str_6081: number = 4; - public static _Str_8971: number = 5; - public static _Str_5958: number = 6; - public static _Str_6065: number = 7; - public static _Str_5998: number = 8; - public static _Str_5904: number = 9; - public static _Str_8909: number = 10; + public static CHAT_TYPE_SPEAK: number = 0; + public static CHAT_TYPE_WHISPER: number = 1; + public static CHAT_TYPE_SHOUT: number = 2; + public static CHAT_TYPE_RESPECT: number = 3; + public static CHAT_TYPE_PETRESPECT: number = 4; + public static CHAT_TYPE_HAND_ITEM_RECEIVED: number = 5; + public static CHAT_TYPE_PETTREAT: number = 6; + public static CHAT_TYPE_PETREVIVE: number = 7; + public static CHAT_TYPE_PET_REBREED_FERTILIZE: number = 8; + public static CHAT_TYPE_PET_SPEED_FERTILIZE: number = 9; + public static CHAT_TYPE_MUTE_REMAINING: number = 10; private _objectId: number; private _message: string; @@ -66,4 +66,4 @@ export class RoomSessionChatEvent extends RoomSessionEvent { return this._style; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomChatHandler.ts b/src/nitro/session/handler/RoomChatHandler.ts index 966246a5..14e428a7 100644 --- a/src/nitro/session/handler/RoomChatHandler.ts +++ b/src/nitro/session/handler/RoomChatHandler.ts @@ -38,10 +38,10 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - let chatType: number = RoomSessionChatEvent.CHAT_NORMAL; + let chatType: number = RoomSessionChatEvent.CHAT_TYPE_SPEAK; - if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_SHOUT; - else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_WHISPER; + if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_SHOUT; + else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_WHISPER; const chatEvent = new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.roomIndex, parser.message, chatType, parser.bubble); @@ -60,7 +60,7 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent._Str_8971, SystemChatStyleEnum.GENERIC, null, parser.handItemType)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent.CHAT_TYPE_HAND_ITEM_RECEIVED, SystemChatStyleEnum.GENERIC, null, parser.handItemType)); } private onRespectReceivedEvent(event: RespectReceivedEvent): void @@ -79,7 +79,7 @@ export class RoomChatHandler extends BaseHandler if(!userData) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, userData.roomIndex, '', RoomSessionChatEvent._Str_5821, SystemChatStyleEnum.GENERIC)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, userData.roomIndex, '', RoomSessionChatEvent.CHAT_TYPE_RESPECT, SystemChatStyleEnum.GENERIC)); } private onFloodControlEvent(event: FloodControlEvent): void @@ -111,6 +111,6 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, session.ownRoomIndex, '', RoomSessionChatEvent._Str_8909, SystemChatStyleEnum.GENERIC, null, parser.seconds)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, session.ownRoomIndex, '', RoomSessionChatEvent.CHAT_TYPE_MUTE_REMAINING, SystemChatStyleEnum.GENERIC, null, parser.seconds)); } }