mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
fix mod tools packet listener
This commit is contained in:
parent
8b4a09bdf6
commit
c959bbc255
@ -20,10 +20,10 @@ export const ModToolsChatlogView: FC<ModToolsChatlogViewProps> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
if(!parser) return;
|
||||
if(!parser || parser.data.roomId !== roomId) return;
|
||||
|
||||
setRoomChatlog(parser.data);
|
||||
}, [setRoomChatlog]);
|
||||
}, [roomId, setRoomChatlog]);
|
||||
|
||||
CreateMessageHook(ModtoolRoomChatlogEvent, onModtoolRoomChatlogEvent);
|
||||
|
||||
|
@ -32,13 +32,15 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
if(!parser || parser.id !== roomId) return;
|
||||
|
||||
setLoadedRoomId(parser.id);
|
||||
setName(parser.name);
|
||||
setOwnerId(parser.ownerId);
|
||||
setOwnerName(parser.ownerName);
|
||||
setOwnerInRoom(parser.ownerInRoom);
|
||||
setUsersInRoom(parser.playerAmount);
|
||||
}, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom ]);
|
||||
}, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom, roomId ]);
|
||||
|
||||
CreateMessageHook(ModtoolRoomInfoEvent, onModtoolRoomInfoEvent);
|
||||
|
||||
|
@ -20,11 +20,11 @@ export const ModToolsUserChatlogView: FC<ModToolsUserChatlogViewProps> = props =
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
if(!parser) return;
|
||||
if(!parser || parser.userId !== userId) return;
|
||||
|
||||
setUsername(parser.username);
|
||||
setUserChatlog(parser.roomVisits);
|
||||
}, [setUsername, setUserChatlog]);
|
||||
}, [setUsername, setUserChatlog, userId]);
|
||||
|
||||
CreateMessageHook(ModtoolUserChatlogEvent, onModtoolUserChatlogEvent);
|
||||
|
||||
|
@ -21,11 +21,10 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
if(!parser) return;
|
||||
if(!parser || parser.data.userId !== userId) return;
|
||||
|
||||
console.log(parser);
|
||||
setUserInfo(parser.data);
|
||||
}, [setUserInfo]);
|
||||
}, [setUserInfo, userId]);
|
||||
|
||||
CreateMessageHook(ModtoolUserInfoEvent, onModtoolUserInfoEvent);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user