Jump to content

CH Changer works, but shows wrong CH under minimap


Recommended Posts

Hello everyone,

after searching a lot i couldn't find the correct way or a solution to fix this problem. Also I have to say, that I'm not so much into that stuff, that's why I'm asking here.

 

The problem which I have is, that the channel changer works perfectly fine, but shows wrong Channel under the mini-map.

It works for all channel and also shows correct channel, when I choose the Ch in the login interface.

But when i change the CH while I'm in the game it works and I get "teleported" in the Channel which I have chosen, but under the mini-map it shows the Ch which I choose when I logged in via login interface.

 

Hope my problem is clear to understand and I hope someone can help me..

 

Regards,

shrdd.

Link to comment
Share on other sites

  • Honorable Member
Spoiler

 



//@Source/Client/UserInterface/PythonNetworkStreamPhaseGame.cpp
//1.) Search for:
	TPacketGCChannel kChannelPacket;
	if (!Recv(sizeof(kChannelPacket), &kChannelPacket))
		return false;
//2.) Add after:
#ifdef WJ_SHOW_ALL_CHANNEL
	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OnChannelPacket", Py_BuildValue("(i)", kChannelPacket.channel));
#endif

//@Source/Client/UserInterface/Locale_inc.h
#define WJ_SHOW_ALL_CHANNEL

//@Source/Client/UserInterface/PythonApplicationModule.cpp
//1.) Search for:
	PyModule_AddIntConstant(poModule, "CAMERA_STOP",			CPythonApplication::CAMERA_STOP);
//2.) Add after:
#ifdef WJ_SHOW_ALL_CHANNEL
	PyModule_AddIntConstant(poModule, "WJ_SHOW_ALL_CHANNEL", 1);
#else
	PyModule_AddIntConstant(poModule, "WJ_SHOW_ALL_CHANNEL", 0);
#endif


//root/game.py
//1.) Search for:
	def RefreshAlignment(self):
		self.interface.RefreshAlignment()
//2.) Add after:
	if app.WJ_SHOW_ALL_CHANNEL:
		def BINARY_OnChannelPacket(self, channel):
			import net
			dict = {'name' : 'Metin2'} # Replace with your server name.
			net.SetServerInfo((localeInfo.TEXT_CHANNEL % (dict['name'], channel)).strip())
			if self.interface:
				self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
			
//locale_en/locale_game.txt:
TEXT_CHANNEL	%s, CH%d

 

From: [Small Release] Show all channel by @VegaS™

 

+++++2018 root:

Spoiler

	if app.ENABLE_MOVE_CHANNEL:
		def __SeverInfo(self, channelNumber, mapIndex):
			#print "__SeverInfo %s %s" % (channelNumber, mapIndex)
			
			_chNum	= int(channelNumber.strip())
			_mapIdx	= int(mapIndex.strip())
			
			if _chNum == 99 or _mapIdx >= 10000:
				chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MOVE_CHANNEL_NOTICE % 0)
			else:
				chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MOVE_CHANNEL_NOTICE % _chNum)
				
			m2netm2g.SetChannelName(_chNum)
			m2netm2g.SetMapIndex(_mapIdx)
			self.interface.RefreshServerInfo()

 

 

Edited by Mali61
  • Good 1
  • Love 1

 

Link to comment
Share on other sites

6 hours ago, Mali61 said:
  Reveal hidden contents

 







//@Source/Client/UserInterface/PythonNetworkStreamPhaseGame.cpp
//1.) Search for:
	TPacketGCChannel kChannelPacket;
	if (!Recv(sizeof(kChannelPacket), &kChannelPacket))
		return false;
//2.) Add after:
#ifdef WJ_SHOW_ALL_CHANNEL
	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OnChannelPacket", Py_BuildValue("(i)", kChannelPacket.channel));
#endif

//@Source/Client/UserInterface/Locale_inc.h
#define WJ_SHOW_ALL_CHANNEL

//@Source/Client/UserInterface/PythonApplicationModule.cpp
//1.) Search for:
	PyModule_AddIntConstant(poModule, "CAMERA_STOP",			CPythonApplication::CAMERA_STOP);
//2.) Add after:
#ifdef WJ_SHOW_ALL_CHANNEL
	PyModule_AddIntConstant(poModule, "WJ_SHOW_ALL_CHANNEL", 1);
#else
	PyModule_AddIntConstant(poModule, "WJ_SHOW_ALL_CHANNEL", 0);
#endif






//root/game.py
//1.) Search for:
	def RefreshAlignment(self):
		self.interface.RefreshAlignment()
//2.) Add after:
	if app.WJ_SHOW_ALL_CHANNEL:
		def BINARY_OnChannelPacket(self, channel):
			import net
			dict = {'name' : 'Metin2'} # Replace with your server name.
			net.SetServerInfo((localeInfo.TEXT_CHANNEL % (dict['name'], channel)).strip())
			if self.interface:
				self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
			
//locale_en/locale_game.txt:
TEXT_CHANNEL	%s, CH%d

 

From: [Small Release] Show all channel by @VegaS™

 

+++++2018 root:

  Hide contents






	if app.ENABLE_MOVE_CHANNEL:
		def __SeverInfo(self, channelNumber, mapIndex):
			#print "__SeverInfo %s %s" % (channelNumber, mapIndex)
			
			_chNum	= int(channelNumber.strip())
			_mapIdx	= int(mapIndex.strip())
			
			if _chNum == 99 or _mapIdx >= 10000:
				chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MOVE_CHANNEL_NOTICE % 0)
			else:
				chatm2g.AppendChat(chatm2g.CHAT_TYPE_INFO, localeInfo.MOVE_CHANNEL_NOTICE % _chNum)
				
			m2netm2g.SetChannelName(_chNum)
			m2netm2g.SetMapIndex(_mapIdx)
			self.interface.RefreshServerInfo()

 

 

First of all thanks for your help. I was trying to put everything like you described. It didn't work..

Edited by shrdd
Link to comment
Share on other sites

  • Honorable Member
4 hours ago, shrdd said:

First of all thanks for your help. I was trying to put everything like you described. It didn't work..

I just tried and it's working without any problem. Entergame(input_login.cpp) function works when you change the channel and enter the game.

and there is this packet in function:

	TPacketGCChannel p2;
	p2.header = HEADER_GC_CHANNEL;
	p2.channel = g_bChannel;
	d->Packet(&p2, sizeof(p2));

So check again

 

Link to comment
Share on other sites

16 hours ago, Mali61 said:

I just tried and it's working without any problem. Entergame(input_login.cpp) function works when you change the channel and enter the game.

and there is this packet in function:


	TPacketGCChannel p2;
	p2.header = HEADER_GC_CHANNEL;
	p2.channel = g_bChannel;
	d->Packet(&p2, sizeof(p2));

So check again

Still doesnt work.. I'm not sure where exactly the problem is. Maybe you can help me via Discord?

Link to comment
Share on other sites

  • 11 months later...
  • 5 months later...
  • 4 months later...

 

Hello @Mali, i like your works, I'm trying implement your file for changing channels. My question is, i found in packet my code with this: https://metin2.download/picture/xNdavPk1dvyC2671nny6mr6GJSFM022C/.png , but there is not: https://metin2.download/picture/DQSr1gd537z9iiSazUj16QIm9X2O0Q20/.png, it could be problem for: if i am in ch1 and ill port to ch2, i have still ch1 writen under minimap, because i tried add what you wrote under the post, but without TPacketGCChannel: it doing this: still same problem with minimap and, when you change channel, your still in channel what you choice at start. So my question if this is not the problem? alsou i found this:https://metin2.download/picture/kAkQubLnF0fu3YC5OScaOBoZkOh6SW0r/.png and I was wondering if ports are written instead of lCustomAddr ? lCustomAddr. Thank you and have a good day ! 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 11

      Multi Language System

    2. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    3. 4

      Feeding game source to LLM

    4. 0

      Quest 6/7 Problem

    5. 5

      Effect weapons

    6. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    7. 3

      Crystal Metinstone

    8. 4

      Feeding game source to LLM

    9. 113

      Ulthar SF V2 (TMP4 Base)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.