Jump to content
Forgot your email address? ×
  • Create New...
  • 0

InGame channel switch



  • Premium

Hello guys :o

I tried / wanted to add the IG ChannelSwitch "system" to my client.

But I found out that it's harder than I thought.

With the buttons I don't have any prolems.

They're looking wonderful.

But I have a problm with their function

The buttons have this function


And here I got stuck. I don't really know how to made the
buttons, so that they're working


Could somebody help me? :unsure:

I found something, but I still don't jnow what to do

import ui
import net
import app
import chat
import math
import wndMgr
import serverInfo
import background
import ServerStateChecker

    def __IsSpecialMap(self):
        dis_maps = [
        if str(background.GetCurrentMapName()) in dis_maps:
            return TRUE
        return FALSE

    def __OnSelectChannel(self):
        if self.ChangeButton.IsDown():

    def __OnClickConnectButton(self):
        regionID = self.__GetRegionID()
        serverID = self.__GetServerID()
        channelID = self.ChannelList.GetSelectedItem()
        if not channelID:
            chat.AppendChat(1, "Erfolgreich!")

            serverName = serverInfo.REGION_DICT[regionID][serverID]["name"]
            channelName = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["name"]
            addrKey = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["key"]
            ip = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["ip"]
            tcp_port = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["tcp_port"]
            state = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"]

            account_ip = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["ip"]
            account_port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["port"]

            markKey = regionID * 1000 + serverID * 10
            net.SetMarkServer(markAddrValue["ip"], markAddrValue["tcp_port"])
            chat.AppendChat(1, "Ein Fehler ist während des Logn Vorgang aufgetreten!")

        if state == serverInfo.STATE_NONE:
            chat.AppendChat(1, "Der ausgewählte channel ist nicht verfügbar!")
        elif state == serverInfo.STATE_DICT[3]:
            chat.AppendChat(1, "Der ausgewählte channel ist voll!")
        elif net.GetServerInfo().strip().split(", ")[1] == self.ChannelList.textDict[self.ChannelList.selectedLine].strip().split(" ")[0]:
            chat.AppendChat(1, "Du befindest dich schon auf diesen channel!")
        elif self.__IsSpecialMap():
            chat.AppendChat(1, "Auf diese Map kannst du den channel nicht wechseln!")

        net.SetServerInfo("%s, %s" % (serverName, channelName))
        self.DirectConnect(ip, tcp_port, account_ip, account_port)

    def DirectConnect(self, ChannelIP, ChannelPort, AuthServerIP, AuthServerPort):
        net.SetLoginInfo(decode_string(net.ACCOUNT_ID), decode_string(net.ACCOUNT_PW))
        net.ConnectToAccountServer(ChannelIP, ChannelPort, AuthServerIP, AuthServerPort)

    def Show(self):

    def Close(self):
        return TRUE

    def OnPressEscapeKey(self):
        return TRUE

    def OnUpdate(self):

iom = ChannelChanger()
chat.AppendChat(1, "#P2#{Erfolgreich!}")
  • Love 1
Link to comment

9 answers to this question

Recommended Posts

  • 0
  • Premium

Do you need this sytem or... ? I don't understand your problem.


The both piece of code looks like different people wrote it, so you are searching this system ?

Link to comment
  • 0
  • Premium

I've made the functions for the buttons.

And I found the code for such a system

on the Internet. And now I need a little bit

of help, to combine bought. It would be nice

if someone could give me an Advice or

something how to combine bought :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021

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.