mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14: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();
|
const parser = event.getParser();
|
||||||
|
|
||||||
if(!parser) return;
|
if(!parser || parser.data.roomId !== roomId) return;
|
||||||
|
|
||||||
setRoomChatlog(parser.data);
|
setRoomChatlog(parser.data);
|
||||||
}, [setRoomChatlog]);
|
}, [roomId, setRoomChatlog]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolRoomChatlogEvent, onModtoolRoomChatlogEvent);
|
CreateMessageHook(ModtoolRoomChatlogEvent, onModtoolRoomChatlogEvent);
|
||||||
|
|
||||||
|
@ -32,13 +32,15 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
|
if(!parser || parser.id !== roomId) return;
|
||||||
|
|
||||||
setLoadedRoomId(parser.id);
|
setLoadedRoomId(parser.id);
|
||||||
setName(parser.name);
|
setName(parser.name);
|
||||||
setOwnerId(parser.ownerId);
|
setOwnerId(parser.ownerId);
|
||||||
setOwnerName(parser.ownerName);
|
setOwnerName(parser.ownerName);
|
||||||
setOwnerInRoom(parser.ownerInRoom);
|
setOwnerInRoom(parser.ownerInRoom);
|
||||||
setUsersInRoom(parser.playerAmount);
|
setUsersInRoom(parser.playerAmount);
|
||||||
}, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom ]);
|
}, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom, roomId ]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolRoomInfoEvent, onModtoolRoomInfoEvent);
|
CreateMessageHook(ModtoolRoomInfoEvent, onModtoolRoomInfoEvent);
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ export const ModToolsUserChatlogView: FC<ModToolsUserChatlogViewProps> = props =
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
if(!parser) return;
|
if(!parser || parser.userId !== userId) return;
|
||||||
|
|
||||||
setUsername(parser.username);
|
setUsername(parser.username);
|
||||||
setUserChatlog(parser.roomVisits);
|
setUserChatlog(parser.roomVisits);
|
||||||
}, [setUsername, setUserChatlog]);
|
}, [setUsername, setUserChatlog, userId]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolUserChatlogEvent, onModtoolUserChatlogEvent);
|
CreateMessageHook(ModtoolUserChatlogEvent, onModtoolUserChatlogEvent);
|
||||||
|
|
||||||
|
@ -21,11 +21,10 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
if(!parser) return;
|
if(!parser || parser.data.userId !== userId) return;
|
||||||
|
|
||||||
console.log(parser);
|
|
||||||
setUserInfo(parser.data);
|
setUserInfo(parser.data);
|
||||||
}, [setUserInfo]);
|
}, [setUserInfo, userId]);
|
||||||
|
|
||||||
CreateMessageHook(ModtoolUserInfoEvent, onModtoolUserInfoEvent);
|
CreateMessageHook(ModtoolUserInfoEvent, onModtoolUserInfoEvent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user