|
You last visited: Today at 23:11
Advertisement
[SAMMELTHREAD] Game Source Changes
Discussion on [SAMMELTHREAD] Game Source Changes within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
01/01/2014, 19:09
|
#1
|
elite*gold: 0
Join Date: Dec 2013
Posts: 48
Received Thanks: 152
|
[SAMMELTHREAD] Game Source Changes
Hello Elitepvpers
After the source been released to public I think that diffs don't make any more sense as people will start working on their own revs and diffs won't work on all the devs. So I made this thread to compile the important changes we made.
Changelog:
Important Changes:
Fix for Licence Check at YMIR Server (main.cpp - function Metin2Server_Check) - RageAtMeBros
void Metin2Server_Check()
{
g_isInvalidServer = false;
}
Fix for External IP Bug (People Getting disconnected after connecting to your server) - RageAtMeBros
BIND_IP: <YOUR PUBLIC IP>
In CONFIG file
config.cpp:
char g_szExternalIP[16] = "0";
----
else if (g_szPublicIP[0] == '0')
{
strlcpy(g_szPublicIP, g_szExternalIP, sizeof(g_szPublicIP));
#ifndef __WIN32__
fprintf(stderr, "PUBLIC_IP: %s interface %s\n", g_szExternalIP, ifap->ifa_name);
#else
fprintf(stderr, "PUBLIC_IP: %s\n", g_szExternalIP);
#endif
}
---
if (!GetIPInfo())
{
strlcpy(g_szPublicIP, g_szExternalIP, sizeof(g_szPublicIP));
}
---
TOKEN("bind_ip")
{
strlcpy(g_szPublicIP, value_string, sizeof(g_szPublicIP));
strlcpy(g_szExternalIP, value_string, sizeof(g_szExternalIP));
}
Changes:
Thanks to:
- 
#LAST UPDATE:
01-01-2013 18:10
|
|
|
01/01/2014, 19:13
|
#2
|
elite*gold: 0
Join Date: Jul 2010
Posts: 190
Received Thanks: 106
|
Thanks bro
|
|
|
01/01/2014, 19:14
|
#3
|
elite*gold: 0
Join Date: Dec 2013
Posts: 48
Received Thanks: 152
|
Quote:
Originally Posted by ~Ok
Thanks bro
|
No problem. By the way you have to put
BIND_IP: <YOUR PUBLIC IP>
In CONFIG file
|
|
|
01/01/2014, 19:20
|
#4
|
elite*gold: 0
Join Date: Nov 2012
Posts: 13
Received Thanks: 0
|
Thanks. About the compile is not some description? I've tried and I've got two files, they should have put it together somehow.
|
|
|
01/01/2014, 19:23
|
#5
|
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,358
|
If someone posts something here please do not copy his stuff just link to his post so anyone who uses it can thank the author for his contribution
|
|
|
01/01/2014, 19:26
|
#6
|
elite*gold: 0
Join Date: Dec 2013
Posts: 48
Received Thanks: 152
|
Quote:
Originally Posted by Mi4uric3
If someone posts something here please do not copy his stuff just link to his post so anyone who uses it can thank the author for his contribution
|
Okay man.
And it should be easier to read aswell, thx for the tip.
|
|
|
01/01/2014, 19:26
|
#7
|
elite*gold: 0
Join Date: Dec 2009
Posts: 113
Received Thanks: 44
|
Quote:
Originally Posted by Mi4uric3
If someone posts something here please do not copy his stuff just link to his post so anyone who uses it can thank the author for his contribution
|
I agree, the ones that publish stuff should deservesome recognition.
EDIT: Tested and seems to be working.
|
|
|
01/01/2014, 19:30
|
#8
|
elite*gold: 24
Join Date: May 2009
Posts: 1,165
Received Thanks: 1,222
|
I don't know, but i think if you posting part's of the source with changes it is not really legal, because of copyrights etc..
If you read the rules, you will know this is not allowed.
Kind regards
|
|
|
01/01/2014, 19:51
|
#9
|
elite*gold: 0
Join Date: May 2009
Posts: 95
Received Thanks: 95
|
Mysql function in quest:
In questlua_global.cpp
before:
Code:
void RegisterGlobalFunctionTable(lua_State* L)
add this code:
Code:
int mysql_do_query(lua_State* L)
{
int i=1;
MYSQL_FIELD *field;
SQLMsg* run = DBManager::instance().DirectQuery(lua_tostring(L,1));
MYSQL_RES* res=run->Get()->pSQLResult;
if (!res){
lua_pushnumber(L, 0);
return 0;
}
MYSQL_ROW row;
lua_newtable(L);
int rowcount = 1;
while(row = mysql_fetch_row(res)){
lua_newtable(L);
lua_pushnumber(L, rowcount);
lua_pushvalue(L, -2);
lua_settable(L, -4);
unsigned int fields = mysql_num_fields(res);
for(int i = 0; i < fields; i++){
lua_pushnumber(L, i + 1);
lua_pushstring(L, row[i]);
lua_settable(L, -3);
}
lua_pop(L, 1);
rowcount++;
}
return 1;
}
after
Code:
{ "get_special_item_group", _get_special_item_group },
add new line
Code:
{ "mysql_query", mysql_do_query },
Save and compile, in quest usage:
quest libmysql begin
state start begin
when login begin
local mysql =mysql_query("SELECT name,level FROM player.player LIMIT 2")
say("Player 1: "..mysql[1][1].." Lv. "..mysql[1][2])
say("Player 2: "..mysql[2][1].." Lv. "..mysql[2][2])
end
end
end
quest libmysql begin
state start begin
when login begin
local mysql = mysql_query("SELECT name,level FROM player.player LIMIT 2")
for key,value in pairs(mysql) do
say("Player"..key..": "..value[1].." Lv. "..value[2])
end
end
end
end
quest libmysql begin
state start begin
when login begin
mysql_query("UPDATE player.player SET level=99 WHERE level>99")
end
end
end
|
|
|
01/01/2014, 19:56
|
#10
|
elite*gold: 0
Join Date: May 2009
Posts: 95
Received Thanks: 95
|
Quote:
Originally Posted by .Risan.
this is from Sonice ....
|
No, this is my source , i wrote this for Sonice.
|
|
|
01/01/2014, 19:59
|
#11
|
elite*gold: 260
Join Date: Jan 2013
Posts: 178
Received Thanks: 104
|
Quote:
#LAST UPDATE:
01-01-2013 18:10
|
xD 2014
|
|
|
01/01/2014, 20:00
|
#12
|
elite*gold: 0
Join Date: Jul 2009
Posts: 386
Received Thanks: 44
|
Quote:
Originally Posted by deco016
No, this is my source , i wrote this for Sonice.
|
@deco016 you know Source of Game 40250?
|
|
|
01/01/2014, 20:00
|
#13
|
elite*gold: 260
Join Date: Jul 2009
Posts: 330
Received Thanks: 140
|
-
|
|
|
01/01/2014, 20:03
|
#14
|
elite*gold: 0
Join Date: Nov 2011
Posts: 395
Received Thanks: 29
|
Quote:
Originally Posted by Metin2 Team
xD 2014
|
eheheheh
|
|
|
01/01/2014, 20:03
|
#15
|
elite*gold: 0
Join Date: May 2009
Posts: 95
Received Thanks: 95
|
Quote:
Originally Posted by siemka256
deco016 you know source of game 40250?
|
yes
|
|
|
Similar Threads
|
[Collection Thread] Ich suche ein Game! / I'm searching for a game!
05/27/2025 - General Gaming Discussion - 3430 Replies
German:
Wenn ihr ein Spiel sucht dann postet es bitte in diesem Thread sonst versinkt die General Gaming Section in solchen Threads.
Wer irgendwas anderes postet als nen Gametipp oder ne Gamesuche bekommt ausnahmslos eine Warnung!
Sofern du auf der Suche nach Browsergames bist, dann verwende dieses Thema.
75%
English:
Please post in this thread if you are searching for a game instead of creating a separate thread otherwise there will be mess in the General Gaming Section because too...
|
All times are GMT +1. The time now is 23:12.
|
|