Portal between Servers
#1
Posté 11 septembre 2011 - 05:23
http://nwvault.ign.c...r.Detail&id=661
http://nwvault.ign.c...s.Detail&id=176
http://nwvault.ign.c...ts.Detail&id=48
http://nwvault.ign.c...s.Detail&id=139
#2
Posté 11 septembre 2011 - 08:48
#3
Posté 13 septembre 2011 - 08:31
I know there is alot of extensibility with the ruby plugin, but I think there was also a udp plugin too.
Basically, the problem you have, in trying to do cross server shouts, is that you need to send the information outside of nwn, and then receive it, and get it back into nwn on the otherside.
the UDP Plugin can send the data, I dont know about receiving it though.
Another way, would be to insert the data/shouts, into a common database/table, shared accross the 2 servers, when the second server sees a shout appear, it then relays it to all the players, and wipes it from the database, to prevent duplication.
#4
Posté 13 septembre 2011 - 09:14
#5
Posté 13 septembre 2011 - 10:33
Modifié par Birdman076, 13 septembre 2011 - 10:52 .
#6
Posté 31 octobre 2011 - 02:55
#7
Posté 01 novembre 2011 - 03:39
#8
Posté 01 novembre 2011 - 06:05
} else if (GetStringLeft(sCText, 7) == "portal ") {
DeleteLocalString(oCPC, "FKY_CHAT_LOCAL_CTEXT");
int nServer;
sCText = GetStringRight(sCText, GetStringLength(sCText) - 7);
if (GetIsInCombat(oCPC) && !VerifyDMKey(oCPC) && !VerifyAdminKey(oCPC)) {
FloatingTextStringOnCreature(COLOR_RED + "You cannot portal during combat!" + COLOR_END, oCPC, FALSE);
return;
}
if (sCText == "here")
nServer = StringToInt(GetLocalString(GetModule(), "ServerNumber"));
else
nServer = StringToInt(sCText);
if (nServer < 110 || nServer > 999) {
FloatingTextStringOnCreature(COLOR_RED + "You cannot portal to that server!" + COLOR_END, oCPC, FALSE);
return;
}
SQLExecDirect("SELECT srv_id, srv_utime, srv_addr, srv_port FROM server_list WHERE srv_id = " + IntToString(nServer) +
" AND srv_utime + 60 >= (UNIX_TIMESTAMP() - srv_btime)");
if (SQLFetch() != SQL_SUCCESS) {
FloatingTextStringOnCreature(COLOR_RED + "That server is not active!" + COLOR_END, oCPC, FALSE);
return;
}
if (!VerifyAdminKey(oCPC) && StringToInt(SQLGetData(2)) < 60) {
FloatingTextStringOnCreature(COLOR_RED + "That server has not been up for a minute yet!" + COLOR_END, oCPC, FALSE);
return;
}
string sAddr = SQLGetData(3) + ":" + SQLGetData(4);
FloatingTextStringOnCreature(COLOR_GREEN + "Portaling you to " + sAddr + "!" + COLOR_END, oCPC, FALSE);
ActivatePortal(oCPC, sAddr, "", "", FALSE);
SetPlotFlag(oCPC, FALSE);
}
string sSQL, sServerNumber = FileReadAll("serverid.txt");
int nServerNumber = StringToInt(sServerNumber);
if (nServerNumber >= 100) {
sServerNumber = IntToString(nServerNumber);
} else {
string sServerIP;
sSQL = "select substring_index(user(), '@', -1) as ip;";
SQLExecDirect(sSQL);
if (SQLFetch() == SQL_SUCCESS)
sServerIP = SQLGetData(1);
else
sServerIP == "";
sServerNumber = GetStringRight(sServerIP, 3);
nServerNumber = StringToInt(sServerNumber);
}
if ((nServerNumber >= 100) && (nServerNumber <= 999)) {
WriteTimestampedLogEntry("running as server " + sServerNumber + " (module object " + ObjectToString(GetModule()) + ")");
SetLocalString(OBJECT_SELF, "ServerNumber", sServerNumber);
} else {
WriteTimestampedLogEntry("Error finding server ip!");
nServerNumber = 101;
sServerNumber = "101";
SetLocalString(OBJECT_SELF, "ServerNumber", "101");
}
if (nServerNumber % 10 == 9) {
SetLocalInt(oMod, "FKY_CHAT_ENABLE_PARTY_TO_AREA", 1);
SetLocalInt(oMod, "FKY_CHAT_ENABLE_SHOUT_TO_AREA", 1);
SetLocalInt(oMod, "FKY_CHAT_ENABLE_TELL_OOC_PREFIX", 1);
SetLocalInt(oMod, "FKY_CHAT_DISALLOW_SPEECH_WHILE_DEAD", 1);
SetLocalInt(oMod, "FKY_CHAT_DISALLOW_SPEECH_WHILE_SILENCED", 1);
}
Here's part 2:
if (SQLFetch() == SQL_SUCCESS) {
string sBootTime = SQLGetData(1);
string sServerAddr = FileReadAll("serveraddr.txt");
string sServerPort = FileReadAll("serverport.txt");
if (StringToInt(sServerPort) < 5000)
sServerPort = "512" + IntToString(nServerNumber % 10);
SetLocalInt(oMod, "boottime", StringToInt(sBootTime));
SetLocalString(oMod, "ServerAddr", sServerAddr);
SetLocalString(oMod, "ServerPort", sServerPort);
SQLExecDirect("REPLACE INTO server_list (srv_id, srv_btime, srv_utime, srv_memory, srv_players, srv_addr, srv_port, srv_last) VALUES ('"
+ sServerNumber + "', " + sBootTime + ", 0, 0, 0, '" + sServerAddr + "', " + sServerPort + ", NOW())");
}
LMK if you have any questions.
Funky
Modifié par FunkySwerve, 01 novembre 2011 - 06:14 .
#9
Posté 01 novembre 2011 - 03:34
Page 2 contains a supposedly fixed plugin. This comes with it's own issues, read all the posts on page 2 and you'll understand better.
nwnx_haks
- New alpha plugin. Allows abitrarily hiding haks and setting a
fallback TLK for players logging in. Currently the script that
checks whether a login is 'enhanced' or not is hardcoded. Haks
can be hidden by level. E.g. a 'basic level' (1) that includes
a top hak with custom classes & a 'full level' that includes
tilesets, etc. It would be up to the builder to ensure that
a player didn't go places that had content he/she did not have the
haks to see. I use it to add custom haks and also a fallback
to CEP and hiding server side HAKs from players.
- Functions: exposed to scripts
int SetFallBackTLK(string sTLK);
int SetHakHidden(string sHak, int nLevel = 1);
void DumpHakList();
void SetPlayerEnhanced(object oPC, int nEnhanced);
Modifié par Calvinthesneak, 01 novembre 2011 - 03:42 .





Retour en haut







