Register for your free account! | Forgot your password?

You last visited: Today at 08:06

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Small Release] Show all channel

Reply
 
Old   #1
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Red face [Small Release] Show all channel

You must register and activate your account in order to view images.

Code:
//@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



VegaS ♆ is offline  
Thanks
8 Users
Old   #2
 
elite*gold: 150
Join Date: Feb 2009
Posts: 535
Received Thanks: 488
Nice! I wanted to "fix" that issue long time ago, but I didn't know how to call a function via source haha!

Learned + Fixxed -> NICE!

MfG
Cyber


Cyber36 is offline  
Old   #3

 
elite*gold: 1
Join Date: May 2014
Posts: 1,509
Received Thanks: 586
xSaito is offline  
Old   #4
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Quote:
Originally Posted by xSaito View Post
Some people not have the same structure of serverInfo.
Check the first post, i edited.


VegaS ♆ is offline  
Thanks
1 User
Old   #5
 
elite*gold: 0
Join Date: Apr 2017
Posts: 13
Received Thanks: 9
You could also fix the channel return issue.
If you enter Channel99 by going to a map hosted on Channel99, you can't go back to a map hosted on CH2.

CH2 -> CH99
CH99 -> CH1

To fix that, we need to remember from where the user came and then we can use that data to choose the right channel.

Kind regards
Raven

You could also fix the channel return issue.
If you enter Channel99 by going to a map hosted on Channel99, you can't go back to a map hosted on CH2.

CH2 -> CH99
CH99 -> CH1

To fix that, we need to remember from where the user came and then we can use that data to choose the right channel.

Kind regards
Raven
Raven al Ghul is offline  
Old   #6
 
elite*gold: 15
Join Date: Mar 2009
Posts: 295
Received Thanks: 149
Hier ne andere Möglichkeit die ich schon seid Jahren benutze.

quest

game.py

uiminimap.py

MFG Lordechen.
Lordechen is offline  
Thanks
1 User
Old   #7
 
elite*gold: 0
Join Date: Aug 2009
Posts: 67
Received Thanks: 23
Code:
def ChannelID(self, channel):
		import dbg
		import serverInfo
		import uiMiniMap
		channelID = int(channel)
		serverName = net.GetServerInfo().split(",")[0]
		channelName = ("CH%d" % (channelID))
		name = ("%s, %s " % (serverName, channelName))
		net.SetServerInfo(name.strip())
		self.interface.wndMiniMap.UpdateServerName()
MityQ is offline  
Old   #8
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Quote:
Originally Posted by Lordechen View Post
Hier ne andere Möglichkeit die ich schon seid Jahren benutze.
MFG Lordechen.
A quest + a text updated for a 10000 times without sense, this is really bad.
You should stay on my method to attach the text on minimap just when he need, not to update on all time -> (def OnUpdate).
Just put this on your function in game.py.
Code:
self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
For version < 40k is ok to do via quest for every login, but the source already is exist since 3 years for all people, already exist a TPacketGCChannel in ymir source what is not used and is sended from server to every enter in map, login, warp, reconnect etc. (CInputLogin::Entergame)

Code:
	TPacketGCChannel p2;
	p2.header = HEADER_GC_CHANNEL;
	p2.channel = g_bChannel;
	d->Packet(&p2, sizeof(p2));
And what i did is just call the function from src client when packet is sended from server and send the channelID to the python.
Code:
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OnChannelPacket", Py_BuildValue("(i)", kChannelPacket.channel));
__________________________________________________
Quote:
Originally Posted by MityQ View Post
Code:
def ChannelID(self, channel):
	import dbg
	import serverInfo
	import uiMiniMap
	channelID = int(channel)
	serverName = net.GetServerInfo().split(",")[0]
	channelName = ("CH%d" % (channelID))
	name = ("%s, %s " % (serverName, channelName))
	net.SetServerInfo(name.strip())
	self.interface.wndMiniMap.UpdateServerName()
Code:
import uiMiniMap
wndMiniMap is a class declared on interfaceModule, you didn't need to call the module uiMiniMap.

Code:
channelID = int(channel)
Already is integer, it is meaningless for declare again as int.

__________________________________________________
You make a split to serverName this is very bad method, let's say something like:
I know the default code in introLogin to seted channel name is with %s, %s (serverName, channelName), but not all people have that, they have rewrited the module and doesn't exist same structure, they have other delimiters like "(, ), [, ], -, |".
  • I'm now in introLogin and select CH4, after then you select will send to src this:
Code:
net.SetServerInfo("Metin2 - Channel %d" % channelID) # This is on my introLogin, delimiter is "-" not ",".
Ok, my serverName was seted with "Metin2 - Channel 4", now i will login in game, that means your function def ChannelID(self, channel) will be called, ok now what will do? will do this:
Code:
Metin2 - Channel 4, CH99
Because not exist the delimiter " , " for can do a split, so will return your original string what is returned from net.GetServerInfo() = "Metin2 - Channel 4".
If you really want to do a split check you should use a check before to do that.
Code:
if ',' in net.GetServerInfo(): print "delimiter exist"
Hmm and also i not understand why you did a split also when already name is seted from serverInfo on REGION_DICT.
Code:
def BINARY_OnChannelPacket(self, channelID):
	net.SetServerInfo(localeInfo.TEXT_CHANNEL % (serverInfo.REGION_DICT[0][1]["name"], channelID))
	self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
__________________________________________________
Here is other thing more nice for some guys maybe.
Code:
	net.SetServerInfo(
		"%s, %s" % (
		serverInfo.REGION_DICT[0][1]["name"], 			
		[localeInfo.CHANNEL_NORMAL % channelID, localeInfo.CHANNEL_GENERAL]
		[channelID is 99]
	))
If channel is 99:
  • Metin2, CH General
If channel is normal like 1,2,3,4 etc:
  • Metin2, CH 1

English isn't my first language, so please excuse any mistakes.
VegaS ♆ is offline  
Old   #9
 
elite*gold: 2600
Join Date: Jul 2009
Posts: 2,437
Received Thanks: 5,531
You could also decide the shown channel based on the port the client is connected to
.Alpha. is offline  
Thanks
1 User
Old   #10
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Thumbs up

Quote:
Originally Posted by .Alpha. View Post
You could also decide the shown channel based on the port the client is connected to
Nice idea
Isn't a best method, but should work fine, i didn't tested on live server.
Code:
if app.WJ_SHOW_ALL_CHANNEL:
	def BINARY_OnChannelPacket(self, port):
		def GetNameByPort(port):
			for _, channelData in serverInfo.SERVER_CHANNEL_DICT.iteritems(): 
				if channelData['tcp_port'] == port: 
					return "%s, %s" % (localeInfo.SERVER_NAME, channelData['name'])
			return "%s, %s" % (localeInfo.SERVER_NAME, localeInfo.CHANNEL_GENERAL)

		net.SetServerInfo(GetNameByPort(port).strip())
		self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
Ymir default dict should look like this:

If channel is 99:
  • Metin2, CH General
If channel is normal like 1,2,3,4 etc:
  • Metin2, CH 1
VegaS ♆ is offline  
Thanks
1 User
Old   #11
 
elite*gold: 0
Join Date: Apr 2017
Posts: 14
Received Thanks: 9
Quote:
Originally Posted by Lordechen View Post
Hier ne andere Möglichkeit die ich schon seid Jahren benutze.

quest

game.py

uiminimap.py

MFG Lordechen.
Vielen Danke Sebastian aka Akito, da ich den Source nicht nutze hilft mir das enorm !
ღ Eatos ღ is offline  
Old   #12
 
elite*gold: 0
Join Date: Mar 2017
Posts: 44
Received Thanks: 2
Thanks for sharing VegaS!
Dakota2Team is offline  
Old   #13
 
elite*gold: 0
Join Date: Jul 2011
Posts: 24
Received Thanks: 14
I have this error:
0807 23:36:13539 :: Traceback (most recent call last):

0807 23:36:13539 :: File "networkModule.py", line 237, in SetGamePhase

0807 23:36:13539 :: File "system.py", line 177, in __hybrid_import

0807 23:36:13539 :: File "
0807 23:36:13539 :: game.py
0807 23:36:13539 :: ", line
0807 23:36:13539 :: 649
0807 23:36:13539 ::

0807 23:36:13539 ::
0807 23:36:13539 :: def RefreshStatus(self):

0807 23:36:13539 ::
0807 23:36:13539 ::
0807 23:36:13539 ::
0807 23:36:13539 :: ^

0807 23:36:13539 :: SyntaxError
0807 23:36:13539 :: :
0807 23:36:13539 :: invalid syntax
0807 23:36:13539 ::


Im i doing something wrong?
My game.py:
def RefreshAlignment(self):
self.interface.RefreshAlignment()

def BINARY_OnChannelPacket(self, channel):
dict = {'name' : 'Metin2'}
net.SetServerInfo((localeInfo.TEXT_CHANNEL % (dict['name'], channel)).strip())
if self.interface:
self.interface.wndMiniMap.serverInfo.SetText(net.G etServerInfo()

def RefreshStatus(self):
self.CheckGameButton()


redryan is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Show small amount of healing
I think the game should show low amounts of healing (+1, +3, +15 healing) on the screen because that visual information is important ... ...
1 Replies - League of Legends Main - Discussions / Questions
[Very Small Relase]Show HP of the monster/character (Cabal PH only)
use cheat engine and add this address manually Address: 00AC537C Value: 1=ON 0=OFF
18 Replies - Cabal Hacks, Bots, Cheats, Exploits & Macros
[Small Relase]Show HP for monster/character (Cabal PH only)
use cheat engine and add this address manually Address: 010C7618 Value: 1=ON 0=OFF Hit thanks if you like it :) screenshot:
34 Replies - Cabal Hacks, Bots, Cheats, Exploits & Macros



All times are GMT +2. The time now is 08:06.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.