A really needed addition: the restart command!
-
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 themselvesDon’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 -
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.
-
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… -
-
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
-
You can release multiple versions; I am sure people are dying for this feature…
-
Someone can will make a plugin based on this code. This is flshell-like restarts
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(); } } [/i][/i]</faction>
-
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.
-
VERY nice work there Cannon
-
VERY nice work there Cannon
YUP!
(And i really enjoy, you just did + posted that, without telling half a year
‘Oh i v done that….’ - ‘…as i told before…’ - ‘…’ - ‘… i m soooo good …’
as we hear from other pebs, without ever seeing, what they did in fact.) -
-
@F!R:
(And i really enjoy, you just did + posted that, without telling half a year
‘Oh i v done that….’ - ‘…as i told before…’ - ‘…’ - ‘… i m soooo good …’
as we hear from other pebs, without ever seeing, what they did in fact.)Sorry Im too stupid to write a plugin, rofl
I said “As soon as New Universe 1.7 is out I will have time to release it (if no one else does it before me).” Well maybe you forgot but some of us have actually something to do in their life despite programming (how about studying at university?). Plus we decided it would be best to have an anticheat solution so I portet about 2500 lines of written code for NU to a big plugin (yes our plugin is about 120Kb compiled). And as expected there were some bugs due to the different way the plugin version handles the function calling of the plugins. Honestly I don’t even care what you say, you say “without ever seeing, what they did in fact”, well make a new char on our server, undock, type i.e. /restart outcast an whoops, you just saw what I wrote…
Im glad there is now an other restart plugin which handles restarts by editing the charfile, I tried to avoid that because of the many warnings the tools give when you do that and used the server functions. So now there are two ways of doing this, maybe someone is willing to combine the techniques. Im still thinking about releasing, maybe I will find time the next days (despite I discovered a problem when using SetAffiliation, but could be plugin version related).
-
Just a heads up….
Your restart plugin dosnt seem to like numbers being in the restart commands name…
We have been using FLShell for restarts, in combination with FLHook, about 2.5 years for clan chars and RP events.
I scrambled the restart names and added a few numbers so players couldnt guess clan restarts and steal equipment, etc…
We moved to a Core2 setup with Server03 and switched to the FLHook 1.6.0 plugin and dropped FLShell as you all know it dosnt play well with a 64 bit setup. I could not get restarts recognized if they had a number in thier name…
Other than that it seems to work perfectly, thanks for the excellent plugins.