Page 1 of 1
Attention all linked worlds!!! VaultSTER upgrade
Posted: Wed Mar 23, 2005 10:57 pm
by Orleron
Hala, Avlis, Mystara, Abyss, EA, Tairis'nadur:
The new version of VaultSTER has been in beta for awhile and seems reasonably stable now. Improvements will be made all along, of course, but I think it's good enough now to switch over CoPaP to the new version.
The new version of VaultSTER cannot link with the old version, so we kinda need to do this changeover all at once, in order to keep the links up.
I've given the go ahead to start the switchover on Avlis. Anyone else have any issues with doing the same right now?
Posted: Wed Mar 23, 2005 11:25 pm
by Tristan_Durst
Question: Is the new version Linux compatable? Was thinking when doing EQ upgrade to switch to Linux.
Thanks,
-Tristan
Posted: Wed Mar 23, 2005 11:25 pm
by Orleron
Seems so, though teleri can speak better about how well it works.
Posted: Thu Mar 24, 2005 2:06 am
by teleri
yes the new version is linux compatable and works well. There are a few code changes that need to occur.
viewtopic.php?t=1024
specificaly this file portal_nwnx_inc.nss
This is the updated code.
Code: Select all
// FileName: portal_nwnx_inc.nss
// Name : Portal include file
// Purpose : Misc code for portalling between servers with NWNX Vaultster
// Authors : Ingmar Stieger, JeroenB
// Modified : February 23, 2005
#include "vaultster_inc"
#include "aps_include"
#include "portal_include"
//void main(){}
// Constants
const int iMaxTries = 30;
const int IDLE = 0;
const int BUSY = 1;
const string SEND_SUCCESS = "0";
const string SEND_BUSY = "2";
const string SEND_ERROR = "3";
// Interface
string GetNWNXStatus();
void WaitForPortalReady(object oPlayer, object oPortal, string sServer, string sWaypoint);
string ConvertToFilename(string sPlayerName);
void PortalPlayerNWNX(object oPlayer, object oPortal, string sServer, string sWaypoint);
// Implementation
string GetNWNXStatus()
{
object oModule = GetModule();
SetLocalString(oModule, "NWNX!SEND!STATUS", GetLocalString(oModule, "NWNX!ODBC!SPACER"));
return GetLocalString(oModule, "NWNX!SEND!STATUS");
}
string ConvertToFilename(string sPlayerName)
{
string sRes;
string sChar;
int i, j;
int iLen = GetStringLength(sPlayerName);
if (iLen > 16)
iLen = 16;
for (i = 0; i < iLen; i++)
{
sChar = GetSubString(sPlayerName, i + j, 1);
if ((sChar != " ") && (sChar != "."))
sRes += sChar;
else
{
i--;
j++;
}
}
return sRes + ".bic";
}
void WaitForPortalReady(object oPlayer, object oPortal, string sServer, string sWaypoint)
{
//string sNWNXStatus = GetNWNXStatus();
int status = PortalStatus (oPlayer);
if (status == VAULTSTER_STATUS_OK)
{
// file successfully sent
DeleteLocalInt(oPlayer, "portal_tries");
DeleteLocalInt(oPortal, "portal_state");
ActivatePortal(oPlayer, GetIPAddress(sServer), GetPlayerPassword(sServer), sWaypoint,
TRUE);
}
else if (status == VAULTSTER_STATUS_BUSY)
{
// busy sending file, wait and try again later (at most 20 times)
int iTries = GetLocalInt(oPlayer, "portal_tries");
if (iTries < iMaxTries)
{
DelayCommand(2.0f, WaitForPortalReady(oPlayer, oPortal, sServer, sWaypoint));
if ((iTries % 4) == 0)
SendMessageToPC(oPlayer, "hold on...");
SetLocalInt(oPlayer, "portal_tries", iTries + 1);
}
else
{
SendMessageToPC(oPlayer,
"Your character file could not be transfered successfully (still busy). Portaling aborted.");
DeleteLocalInt(oPlayer, "portal_tries");
DeleteLocalInt(oPortal, "portal_state");
}
}
else if (status == VAULTSTER_STATUS_ERROR)
{
// an error occured
SendMessageToPC(oPlayer,
"Your character file could not be transfered successfully (an error occured). Portaling aborted.");
DeleteLocalInt(oPlayer, "portal_tries");
DeleteLocalInt(oPortal, "portal_state");
}
}
void PortalPlayerNWNX(object oPlayer, object oPortal, string sServer, string sWaypoint)
{
/*
* Not neccessary here anymore. New vaultster can portal
* multiple players at same time. Export is taken care of in
* PortalPC function.
if (GetLocalInt(oPortal, "portal_state") == BUSY)
{
SendMessageToPC(oPlayer, "Portal is currently occupied. Please try again later.");
return;
}
ExportSingleCharacter(oPlayer);
*/
// get ip address from database and remove any port definition
string sServerIP = GetIPAddress(sServer);
int iPos = FindSubString(sServerIP, ":");
if (iPos != -1)
sServerIP = GetStringLeft(sServerIP, iPos);
/*
* old format, should not be used anymore
string sFilename = ConvertToFilename(GetName(oPlayer));
string sJob = sServerIP + "|" + GetPCPlayerName(oPlayer) + "|" + sFilename;
SetLocalString(GetModule(), "NWNX!SEND!SEND", sJob);
*/
int ret = PortalPC (oPlayer, sServerIP);
if (ret != VAULTSTER_OK) {
SendMessageToPC (oPlayer, "Failed to portal.");
}
else {
SendMessageToPC(oPlayer, "Trying to portal...");
DelayCommand(5.0f, WaitForPortalReady(oPlayer, oPortal, sServer, sWaypoint));
/*
* Also not neccessary to set
SetLocalInt(oPortal, "portal_state", BUSY);
*/
}
}