Jump to content

Recommended Posts

Hi! I have a small question about the whole ServerStateChecker method. Everything works fine with the system, except for the channel state update.

When I login for the first time, it looks like this: (CH1, CH2, and CH3 are online, but don't update)

27lgTrX.png

Only after I change the CH it updates to the correct values.

VviqIeT.png

uisystem.py MoveChannelWindow class: https://pastebin.com/694HbPX1

The values in serverinfo.py are changed by the NotifyChannelState function, I just don't know how to make them "reload" when the window is opened.

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Confused 1
Link to comment
https://metin2.dev/topic/20998-channel-state-update/
Share on other sites

  • Honorable Member
33 minutes ago, Paikei said:

Hi! I have a small question about the whole ServerStateChecker method. Everything works fine with the system, except for the channel state update.

When I login for the first time, it looks like this: (CH1, CH2, and CH3 are online, but don't update)

27lgTrX.png

Only after I change the CH it updates to the correct values.

VviqIeT.png

uisystem.py MoveChannelWindow class: https://pastebin.com/694HbPX1

The values in serverinfo.py are changed by the NotifyChannelState function, I just don't know how to make them "reload" when the window is opened.

 

If you want to update the values upon window opening:

Call the method inside the _init_ def. You'll have to pass the needed args to it. (addrKey, state).

If you want to update the values every login/map change: (still fixes your issue, but it's less precise)

Call the method inside the Open def. You'll have to pass the needed args to it. (addrKey, state).

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Confused 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-113893
Share on other sites

21 minutes ago, Syreldar said:

If you want to update the values upon window opening:

Call the method inside the _init_ def. You'll have to pass the needed args to it. (addrKey, state).

If you want to update the values every login/map change: (still fixes your issue, but it's less precise)

Call the method inside the Open def. You'll have to pass the needed args to it. (addrKey, state).

Am I not doing this already by calling self.RequestServerState() in the _init_?

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-113897
Share on other sites

  • Honorable Member
1 minute ago, Paikei said:

Am I not doing this already by calling self.RequestServerState() in the _init_?

The function that updates the states is NotifyChannelState, and it doesn't get called there as far as I can read from the pastebin.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-113898
Share on other sites

1 minute ago, Syreldar said:

The function that updates the states is NotifyChannelState, and it doesn't get called there as far as I can read from the pastebin.

That is exactly what I'm unsure about. It's not called anywhere in the client, instead it gets executed by the binary after calling the RequestServerState function as far as I'm aware.

NotifyChannelState does get called, and it does change the values. It's just that the text itself doesn't update.

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-113899
Share on other sites

  • Honorable Member
1 hour ago, Paikei said:

That is exactly what I'm unsure about. It's not called anywhere in the client, instead it gets executed by the binary after calling the RequestServerState function as far as I'm aware.

NotifyChannelState does get called, and it does change the values. It's just that the text itself doesn't update.

It means it doesn't get called when it should, that's the only function that changes the states so I'm pretty sure I can't be wrong here. Try doing as I said.

self.__RefreshChannelStateList() <- Check this out also.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-113903
Share on other sites

  • 6 years later...
  • Active Member
  
  def NotifyChannelState(self, addrKey, state):
        try:
            stateName = serverinfo.STATE_DICT[state]
        except:
            stateName = serverinfo.STATE_NONE
        
        regionID  = int(addrKey / 1000)
        serverID  = int(addrKey / 10) % 100
        channelID = addrKey % 10
        try:
            serverinfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"] = stateName
            self.__Fill_Up_ChannelList()
        except:
            pass

 

Link to comment
https://metin2.dev/topic/20998-channel-state-update/#findComment-171293
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.