Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
92 user(s) are online (29 user(s) are browsing Forum)

Members: 0
Guests: 92

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +5€

Current balance: 0€
(last updated 06/2020)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 34 users playing Freelancer on 44 servers.
July. 6, 2020

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post

« 1 2 (3) 4 »


Re: A really needed addition: the restart command!
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3520
Offline
I think F!R is right, but, as Mindhunter said, I think we should slowly get back to the original topic of this thread. If you want to continue this discussion, feel free to make a new thread.

Posted on: 2008/7/29 15:53
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: A really needed addition: the restart command!
Just can't stay away
Joined:
2008/2/20 20:34
From the Netherlands
Group:
Registered Users
FLServer Admins
Senior Members
Posts: 242
Offline
Quote:

Makes me laugh that so many people have a problem paying for FLAC


And it makes me wonder how less people know the devenition from the word "donation"
A donation is a free amount of fee, stuff which people can decide how much he/she wanna give.

A program like for instance Milkshape, it's a payed program. If you go to the store, than you buy your shoppings. The price you pay for that, you call that also a donation? i'm not.
So in this case, how good or bad FLAC is, it's a payed program for commercial use. The price you have to pay for the program is 35 euro. So, this isn't a donation.
Otherwise he leave the amount of fee up to the people themselves

Don't care if he ask a price for it, that's not my point.
Everybody needs to make a living. And if he can sell the program for good bucks, fine.
But pls, be honest than, and don't call it a
"donation"

So, i wouldn't be laugh to loud if i was you

@Friendlyfire: Sorry, both make the post at the same time.
Right, back to topic

Posted on: 2008/7/29 16:06
Open in new window
~~My spells are dangerous~~

WTS for the Game. WTS for the World
Top
Re: A really needed addition: the restart command!
Quite a regular
Joined:
2008/7/25 20:57
Group:
Registered Users
Posts: 107
Offline
I run Flshell and Flhook at same time on my server, so I dont have any need for this command hehe.

Posted on: 2008/8/31 1:13
Top
Re: A really needed addition: the restart command!
Home away from home
Joined:
2008/6/5 16:18
From Germany
Group:
Banned!
Posts: 546
Offline
yeah but unfortunatly flshell does refuse to work on 64bit servers

Posted on: 2008/8/31 8:40
Top
Re: A really needed addition: the restart command!
Just can't stay away
Joined:
2008/5/13 17:01
From Upper Midwest, USA
Group:
Registered Users
FLServer Admins
Posts: 202
Offline
Quote:

I run Flshell and Flhook at same time on my server, so I dont have any need for this command hehe.


Sounds like a familiar Combination to me as well. And OPR8R is right, FLShell is older, out of development and we have no access to the source code to fix it. In my case, FLShell's console key intercepts are snagging the /u admin command, basically neutering any FLHook /u.. command in the version we are trying to use, most annoying to some is /uncloak. But even with this "reason" to want FLShell replaced, some of the other items "We" use likely would not allow 64bit anyway. ;D

So for now has any additional progress on a plug-in in this area been made as yet?

AND PLEASE, No more from FLAC camp in the FLHook threads,, it is getting as pitiful as sending Ford Car Salesmen to sabotage a Chevrolet auction.

Posted on: 2008/9/1 1:03
Grey-Wolf can be found Prowling WTS-WORLD
Top
Re: A really needed addition: the restart command!
Quite a regular
Joined:
2008/7/25 20:57
Group:
Registered Users
Posts: 107
Offline
yeah and it cant be that hard to code a simple restart template plugin,

Posted on: 2008/12/7 1:25
Top
Re: A really needed addition: the restart command!
Starport Staff
Joined:
2008/8/4 23:29
From United Kingdom
Group:
Registered Users
Senior Members
Posts: 310
Offline
No idea how anyone would go about implementing this theory but here are my thoughts on the subject:
------------------------------------------------------------------------------------------------------------------------------------------------

1.Have a folder server side with template FL Files in e.g.


  • 1.Smuggler - Imperials

  • 2.Smuggler - Rebels

  • 3.Heavy Bomber - Imperials

  • 4.Heavy Bomber - Rebels

  • 5.Pirate

  • 6.Civilian



2.A player types /restart in game and he/she is offered that list, they type in the corresponding number

3a)they are kicked, their FL File is deleted and replaced with the template they chose (obviously with the same name and directory)
OR
3b)they are kicked, the contents of the template are copied and pasted into their FL File...




Posted on: 2008/12/7 7:14
Top
Re: A really needed addition: the restart command!
Quite a regular
Joined:
2008/7/25 20:57
Group:
Registered Users
Posts: 107
Offline
could be done by having it edit all but the name of the char in the FL file probably, but how to code that...

Posted on: 2008/12/7 8:11
Top
Re: A really needed addition: the restart command!
Home away from home
Joined:
2008/7/8 21:15
From Germany
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 588
Offline
As I stated before I already have solved this and recently ported every feature I wrote for New Universe to a plugin, including the restart command. I did some changes to the restart and so far there were no bugs discovered, so i am thinking about releasing the restart command as a plugin soon. The question is wether to wait until I implemented to change the ship and loadout or not. Depends on what the people want I guess

Posted on: 2008/12/7 21:53
Top
Re: A really needed addition: the restart command!
Quite a regular
Joined:
2008/7/25 20:57
Group:
Registered Users
Posts: 107
Offline
you could do it now and then, basicly other ppl will edit anything to fit their needs.

Posted on: 2008/12/8 11:16
Top
Re: A really needed addition: the restart command!
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3520
Offline
You can release multiple versions; I am sure people are dying for this feature...

Posted on: 2008/12/8 20:29
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: A really needed addition: the restart command!
Just popping in
Joined:
2008/12/18 2:22
From Ukraine
Group:
Registered Users
Posts: 2
Offline
Someone can will make a plugin based on this code. This is flshell-like restarts
Code:
void UserCmd_Dots(uint iClientID, wstring wscParam)
{
if(set_bAllowRestarts)
{
WIN32_FIND_DATA FileData; 
HANDLE hSearch; 
 
wchar_t oldDir[MAX_PATH];
GetCurrentDirectoryW(MAX_PATH,oldDir);
SetCurrentDirectoryW(set_wscRestartDotsPath.c_str());
BOOL fFinished = FALSE; 
 
// Start searching for .fl files in the current directory. 
 
hSearch = FindFirstFile("*.fl", &FileData); 
if (hSearch == INVALID_HANDLE_VALUE) 

PrintUserCmdText(iClientID, L"Dots not found");
FindClose(hSearch);
SetCurrentDirectoryW(oldDir);
return;

 
wstring wscMsg =L"";
string scFileName=""; 
// 
while (!fFinished) 

// add filename
scFileName = FileData.cFileName;
size_t len = scFileName.length();
scFileName.erase(len-3,len);
if (scFileName[0]!='_')
wscMsg+=stows(scFileName)+L" ";
if (!FindNextFile(hSearch, &FileData)) 
{
if (GetLastError() == ERROR_NO_MORE_FILES) 

PrintUserCmdText(iClientID, L"You can use these restarts:");
PrintUserCmdText(iClientID, wscMsg);
fFinished = TRUE; 

else 

PrintUserCmdText(iClientID, L"Internal server error");
FindClose(hSearch);
SetCurrentDirectoryW(oldDir);
return;

}

// Close the search handle. 
 
FindClose(hSearch);
SetCurrentDirectoryW(oldDir);
}
else
{
PRINT_DISABLED();
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
void UserCmd_Restart(uint iClientID, wstring wscParam)
{
if(ClientInfo[iClientID].bAllowRestart)
{
wstring wscError[] = 
{
L"Error: Invalid parameters",
L"Usage: /restart <faction>",
};

wstring wscFraction = GetParam(wscParam, ' ', 0);

if(!wscFraction.length())
PRINT_ERROR();

// get rank for MaxRank limit
int iRank;
pub::Player::GetRank(iClientID, iRank);
 
// searching restart
string scPathDot=wstos(set_wscRestartDotsPath) + wstos(wscFraction)+".fl";
if(_access( scPathDot.c_str(), 0 ))
{// file not exists
scPathDot=wstos(set_wscRestartDotsPath) + "_" + wstos(wscFraction)+".fl";
if(_access( scPathDot.c_str(), 0 ))
{
PRINT_ERROR();
return;
}
}

if (iRank > set_iMaxRank)
{
PrintUserCmdText(iClientID,L"Error: You must create a new char to restart. Your rank is too high");
return;
}

wstring wscCharname=Players.GetActiveCharacterName(iClientID);


// Kick player
CAccount *acc = Players.FindAccountFromClientID(iClientID);
HkMsgAndKick(iClientID, L" restarting... ",set_iKickMsgPeriod);
acc->ForceLogout();

// get savefile
wstring wscDir;
if(!HKHKSUCCESS(HkGetAccountDirName(acc, wscDir)))
{
string err=wstos(L"Restart failed. " + wscCharname + L" not exists. wscDir = "+wscDir);
AddLog(err.c_str());
return;// HKE_CHAR_DOES_NOT_EXIST;
}

wstring wscFile;
HkGetCharFileName(wscCharname, wscFile);
string scCharFile = scAcctPath + wstos(wscDir) + "\\" + wstos(wscFile) + ".fl";

// delete savefile
if(!(_access( scCharFile.c_str(), 0 )))
{// file exists
DeleteFile(scCharFile.c_str());
}

// rewrite savefile
if(!(CopyFile(scPathDot.c_str(),scCharFile.c_str(),FALSE)))
{
string err=wstos(L"Restart failed. " + wscCharname + L". Files not copied ");
AddLog(err.c_str());
return;// HKE_CHAR_DOES_NOT_EXIST;
}

// restore nickname. Copy&Paste from HkRename
wstring wscNewNameString = L"";
for(uint i = 0; (i < wscCharname.length()); i++)
{
char cHiByte = wscCharname[i] >> 8;
char cLoByte = wscCharname[i] & 0xFF;
wchar_t wszBuf[8];
swprintf(wszBuf, L"%02X%02X", ((uint)cHiByte) & 0xFF, ((uint)cLoByte) & 0xFF);
wscNewNameString += wszBuf;
}
if(HkIsEncoded(scCharFile)) 
{
string scCharFileNew = scCharFile + ".ini";

if(!flc_decode(scCharFile.c_str(), scCharFileNew.c_str()))
{
string err=wstos(L"Restart failed. Name " + wscCharname + L" not set. File ")+scCharFile;
AddLog(err.c_str());
return;// HKE_COULD_NOT_DECODE_CHARFILE;
}

IniWrite(scCharFileNew, "Player", "name", wstos(wscNewNameString));

if(!flc_encode(scCharFileNew.c_str(), scCharFile.c_str()))
{
string err=wstos(L"Restart failed. Name " + wscCharname + L" not set. File ")+scCharFile;
AddLog(err.c_str());
return;// HKE_COULD_NOT_ENCODE_CHARFILE;
}
DeleteFile(scCharFileNew.c_str());

else 
{
IniWrite(scCharFile, "Player", "name", wstos(wscNewNameString));
}
}
else
{
PRINT_DISABLED();
}
}

Posted on: 2008/12/18 2:40
Top
Re: A really needed addition: the restart command!
Starport Admin
Joined:
2008/2/26 20:36
From Germany
Group:
Webmasters
Registered Users
Posts: 1784
Offline
Can you give the name of the author of the posted code?

Should be very easy to put in plugin form. (copy & paste anyone^^)

Posted on: 2008/12/18 3:28
aka chaosgrid
http://www.freelancerserver.de
https://www.moddb.com/mods/fwtow
Top
Re: A really needed addition: the restart command!
Just can't stay away
Joined:
2008/8/21 4:48
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 454
Offline
Right, I've hacked up a plugin with this functionality. You can get it here

http://host-a.net/Cannon/restart0.1_plugin.zip

I haven't done much testing but it seems to work okay. Comments and questions welcome.

It'll be up on the forge shortly...as soon as I can get the forge upload working again.

I've based the code on the post by Jerzy - with a few modifications. If anyone knows the original author(s) of the code please let me know and I'll credit them.

Posted on: 2008/12/18 9:10
Top
Re: A really needed addition: the restart command!
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3520
Offline
VERY nice work there Cannon

Posted on: 2008/12/18 9:32
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
« 1 2 (3) 4 »