|
You last visited: Today at 16:27
Advertisement
[Small Release] Show all channel
Discussion on [Small Release] Show all channel within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
04/03/2017, 15:48
|
#1
|
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
|
[Small Release] Show all channel
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
|
|
|
04/03/2017, 20:07
|
#2
|
elite*gold: 150
Join Date: Feb 2009
Posts: 643
Received Thanks: 613
|
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
|
|
|
04/03/2017, 23:47
|
#3
|
elite*gold: 17
Join Date: May 2014
Posts: 2,101
Received Thanks: 1,292
|
0403 23:46:27385 :: File "game.py", line 746, in BINARY_OnChannelPacket
0403 23:46:27386 :: AttributeError
0403 23:46:27386 :: :
0403 23:46:27386 :: 'module' object has no attribute 'NAME1'
0403 23:46:27386 ::
|
|
|
04/03/2017, 23:55
|
#4
|
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
|
Quote:
Originally Posted by xSaito
0403 23:46:27385 :: File "game.py", line 746, in BINARY_OnChannelPacket
0403 23:46:27386 :: AttributeError
0403 23:46:27386 :: :
0403 23:46:27386 :: 'module' object has no attribute 'NAME1'
0403 23:46:27386 ::
|
Some people not have the same structure of serverInfo.
Check the first post, i edited.
|
|
|
04/04/2017, 05:49
|
#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
|
|
|
04/06/2017, 10:18
|
#6
|
elite*gold: 15
Join Date: Mar 2009
Posts: 295
Received Thanks: 150
|
Hier ne andere Möglichkeit die ich schon seid Jahren benutze.
quest
Code:
quest xxx begin
state start begin
when login begin
cmdchat("set_channel_id Server_Name_-_Ch_"..pc.get_channel_id())
end
end
end
game.py
bei "def __ServerCommand_Build(self):" einfügen
Code:
"set_channel_id" : self.__set_channel_id,
an das ende
Code:
def __set_channel_id(self, text):
text = text.replace("_", " ")
net.SetServerInfo(str(text))
uiminimap.py
in der "class MiniMap(ui.ScriptWindow):" bei "def OnUpdate(self):" einfügen falls nicht vorhanden
Code:
self.serverInfo.SetText(net.GetServerInfo())
MFG Lordechen.
|
|
|
04/09/2017, 23:56
|
#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()
|
|
|
04/10/2017, 02:48
|
#8
|
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
|
Quote:
Originally Posted by Lordechen
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
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()
|
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:If channel is normal like 1,2,3,4 etc:
English isn't my first language, so please excuse any mistakes.
|
|
|
04/10/2017, 02:53
|
#9
|
elite*gold: 0
Join Date: Jul 2009
Posts: 2,471
Received Thanks: 5,622
|
You could also decide the shown channel based on the port the client is connected to
|
|
|
04/10/2017, 06:12
|
#10
|
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
|
Quote:
Originally Posted by .Alpha.
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:
Code:
SERVER_CHANNEL_DICT = {
1: {'key':11, 'name': 'CH1', 'ip': '0.0.0.0', 'tcp_port' :22111, 'udp_port': 22111, 'state': STATE_NONE,},
2: {'key':12, 'name': 'CH2', 'ip': '0.0.0.0', 'tcp_port' :22121, 'udp_port': 22121, 'state': STATE_NONE,},
3: {'key':13, 'name': 'CH3', 'ip': '0.0.0.0', 'tcp_port' :22131, 'udp_port': 22131, 'state': STATE_NONE,},
4: {'key':14, 'name': 'CH4', 'ip': '0.0.0.0', 'tcp_port' :22141, 'udp_port': 22141, 'state': STATE_NONE,},
5: {'key':15, 'name': 'CH5', 'ip': '0.0.0.0', 'tcp_port' :22151, 'udp_port': 22151, 'state': STATE_NONE,},
6: {'key':16, 'name': 'CH6', 'ip': '0.0.0.0', 'tcp_port' :22161, 'udp_port': 22161, 'state': STATE_NONE,},
}
If channel is 99: If channel is normal like 1,2,3,4 etc:
|
|
|
04/10/2017, 15:51
|
#11
|
elite*gold: 0
Join Date: Apr 2017
Posts: 16
Received Thanks: 15
|
Quote:
Originally Posted by Lordechen
Hier ne andere Möglichkeit die ich schon seid Jahren benutze.
quest
Code:
quest xxx begin
state start begin
when login begin
cmdchat("set_channel_id Server_Name_-_Ch_"..pc.get_channel_id())
end
end
end
game.py
bei "def __ServerCommand_Build(self):" einfügen
Code:
"set_channel_id" : self.__set_channel_id,
an das ende
Code:
def __set_channel_id(self, text):
text = text.replace("_", " ")
net.SetServerInfo(str(text))
uiminimap.py
in der "class MiniMap(ui.ScriptWindow):" bei "def OnUpdate(self):" einfügen falls nicht vorhanden
Code:
self.serverInfo.SetText(net.GetServerInfo())
MFG Lordechen.
|
Vielen Danke Sebastian aka Akito, da ich den Source nicht nutze hilft mir das enorm !
|
|
|
04/14/2017, 22:24
|
#12
|
elite*gold: 0
Join Date: Mar 2017
Posts: 51
Received Thanks: 3
|
Thanks for sharing VegaS!
|
|
|
08/08/2017, 00:38
|
#13
|
elite*gold: 0
Join Date: Jul 2011
Posts: 25
Received Thanks: 15
|
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()
|
|
|
05/06/2019, 01:18
|
#14
|
elite*gold: 0
Join Date: Aug 2015
Posts: 1
Received Thanks: 0
|
How i can be ? channel99 = channel X ? how i can change ?
|
|
|
Similar Threads
|
Show small amount of healing
07/28/2014 - League of Legends - 1 Replies
I think the game should show low amounts of healing (+1, +3, +15 healing) on the screen because that visual information is important ...
Moreover, it should show both your healing and the allies and enemies, because has the option to disable this text
What do you think?
Sorry for my bad english :c
|
[Very Small Relase]Show HP of the monster/character (Cabal PH only)
03/27/2014 - Cabal Hacks, Bots, Cheats, Exploits & Macros - 18 Replies
use cheat engine and add this address manually
Address: 00AC537C
Value:
1=ON
0=OFF
|
[Small Relase]Show HP for monster/character (Cabal PH only)
06/07/2013 - Cabal Hacks, Bots, Cheats, Exploits & Macros - 34 Replies
use cheat engine and add this address manually
Address: 010C7618
Value:
1=ON
0=OFF
Hit thanks if you like it :)
screenshot:
|
All times are GMT +1. The time now is 16:28.
|
|