Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ecs] Potential Duplicate Entity Problem? #448

Open
@KoertLichtendonk

Description

@KoertLichtendonk

I assume that this is a rare SampSharp bug that occurs in some weirdly specific situation as I have no other explanation for this. On my server it randomly started sending double messages in chat to every player. Never had this happen before, and haven't done any changes to the chat logic that could've caused it.

Image

The OOC command loops through every Player and does SendClientMessage, so I don't think there can go much wrong on my side. It almost feels like there are two of the same Player entities.

Unfortunately there isn't much else I can tell you to narrow down the potential issue, it randomly happened after I logged in, before that everything was fine. Here is the /ooc code:

publicclassChatCommands:ISystem{[ServerCommand(PermissionGroups=newstring[]{"Default"},Description="Send a message to the global Out-Of-Character (OOC) chat. Use /ooc followed by your message to communicate OOCly with all players.",CommandGroups=new[]{"Chat"})]publicvoidOoc(Playerplayer,IEntityManagerentityManager,IDiscordServicediscordService,stringtext){if(player.IsPlayerPlayingAsCharacter()){player.SendPlayerChatMessage(entityManager,PlayerChatMessageType.OOC,text);discordService.SendGlobalOocChatMessage(player,text);}}}publicstaticclassChatHelper{publicstaticvoidSendPlayerChatMessage(thisPlayerplayer,IEntityManagerentityManager,PlayerChatMessageTypetype,stringtext){if(player.IsPlayerPlayingAsCharacter()){CharacterModelcharacter=player.GetPlayerCurrentlyPlayingAsCharacterModel();switch(type){casePlayerChatMessageType.OOC:stringCHAT_ACTION_OOC=String.Format("(( OOC | {0}: {1} ))",character.GetCharacterName(),text);foreach(PlayerforeachPlayerinentityManager.GetComponents<Player>()){foreachPlayer.SendClientMessage("{D3D3D3}"+CHAT_ACTION_OOC);}break;}}}}

I'm curious if anyone else has ever had this issue?

I have a Discord bot that sends messages from /ooc to Discord, and in Discord only one message appears, which is another reason that leads me to believe this might be a rare SampSharp bug.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp