[Plug-in] SSGM2.02 Ping Plugin [message #381102] |
Sat, 18 April 2009 14:28 |
|
ExEric3
Messages: 746 Registered: February 2005 Location: Slovakia
Karma: 0
|
Colonel |
|
|
ReadMe:
Name: SSGM Ping Plugin
Version: v1.0
Author: ExEric3
This is a plug-in was designed to work with SSGM 2.02 for Renegade.
It was written by ExEric3 from SK-Gaming Community - renegade.selfip.net
This is the first release version and probably has some bugs.
This plug-in allows to players see their ping in game. There are acceptable these strings for players to type:
!ping - display your current ping
!ping <nickname> - display ping for specified player (full nick must be specified)
To use this plug-in, refer to SSGM.ini in your SSGM 2.02 server folder.
You'll need to add the .dll to the server folder, and make an entry in the [Plugins] section, mine looks like this:
[Plugins]
01=Ping
This plug-in is also compatible with Resurrection.
Special thanks to:
jindrak2 - original idea
reborn - readme and his source codes
Ghostshaw - helped with chathook
[Updated on: Wed, 22 July 2009 09:56] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395940 is a reply to message #395916] |
Wed, 22 July 2009 15:26 |
|
ExEric3
Messages: 746 Registered: February 2005 Location: Slovakia
Karma: 0
|
Colonel |
|
|
Nightma12 wrote on Wed, 22 July 2009 20:29 | Why code this when both BR *AND* NR include these features by default?
Seems a bit redundant and reinventing the wheel?
|
Well for BR some times display wrong values. Always higher ping like in game. Dunno if its average ping or what. But yeah this is much faster.
Its good plugin for people which using another regulators. Like CloudyServ.
Miklo wrote on Wed, 22 July 2009 21:06 | in nr dont work ,,,
|
This plugin or ping in NR?
[Updated on: Wed, 22 July 2009 15:27] Report message to a moderator
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395961 is a reply to message #395924] |
Wed, 22 July 2009 22:33 |
|
Nightma12
Messages: 2593 Registered: August 2003
Karma: 0
|
General (2 Stars) Category Moderator |
|
|
jnz wrote on Wed, 22 July 2009 13:55 |
Nightma12 wrote on Wed, 22 July 2009 19:29 | Why code this when both BR *AND* NR include these features by default?
Seems a bit redundant and reinventing the wheel?
|
It's much quicker, doesn't hog memory and doesn't assist hard drive fragmentation.
|
NR hogs memory? thats new to me! I agree with the fragmentation though, but alas.... unless your going to write an entire bot in an SSGM plugin.. why ahve a single feature like this thats provided wit hthe bot already? lol
Quote: | in nr dont work ,,,
|
Works fine on my serv....
Quote: | Well for BR some times display wrong values. Always higher ping like in game. Dunno if its average ping or what. But yeah this is much faster.
Its good plugin for people which using another regulators. Like CloudyServ.
|
Fair enough lol, im not being rude and insulting your work, it just seems a lil strange that you would recode 'parts' of the bot into an SSGM plugin for a feature thats already available and runs fine. (Or at least the NR pings are correct =/ lol)
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396039 is a reply to message #381102] |
Thu, 23 July 2009 19:36 |
dr3w2
Messages: 485 Registered: September 2006 Location: Ottawa,Canada
Karma: 0
|
Commander |
|
|
Weird. If i run the DLL it came with, no problems. When i open the source and compile without even doing any changes it crashes the FDS
Anyone have any ideas?
Newly installed FDS, then Corepatch, then SSGM 2.0.2. No other files or configurations changed.
n00bstories Server Administrator
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396088 is a reply to message #396081] |
Fri, 24 July 2009 05:31 |
|
Goztow
Messages: 9737 Registered: March 2005 Location: Belgium
Karma: 13
|
General (5 Stars) Goztoe |
|
|
Sladewill wrote on Fri, 24 July 2009 13:14 | not everyone even wants to use BR or NR they are pretty useless. Most ppl want to script there own bots in C++ which makes life so much easier when coding and if the server goes down the bot does as well if its included in ssgm source.
|
Ermmm.... most people DO NOT want to script their own bots because most people don't know how to script a bot. And scripting your bot in scripts also has a serious risk: if there's a bug that makes your bot crash, it also crashes your FDS, whereas a bug crashing brenbot will only crash brenbot. Which in turn makes it easier to debug.
You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396222 is a reply to message #396039] |
Sat, 25 July 2009 14:56 |
dr3w2
Messages: 485 Registered: September 2006 Location: Ottawa,Canada
Karma: 0
|
Commander |
|
|
andr3w282 wrote on Thu, 23 July 2009 21:36 | Weird. If i run the DLL it came with, no problems. When i open the source and compile without even doing any changes it crashes the FDS
Anyone have any ideas?
Newly installed FDS, then Corepatch, then SSGM 2.0.2. No other files or configurations changed.
|
bump for ideas
n00bstories Server Administrator
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396226 is a reply to message #381102] |
Sat, 25 July 2009 15:16 |
dr3w2
Messages: 485 Registered: September 2006 Location: Ottawa,Canada
Karma: 0
|
Commander |
|
|
actually with ravens help it was the compiler. I'm using visual studio 2008 and in order to use compiled plugins with vs08 you need to compile ssgm in 08 as well as apposed to the original. Strange.
n00bstories Server Administrator
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439290 is a reply to message #381102] |
Fri, 12 November 2010 00:41 |
|
Xpert
Messages: 1588 Registered: December 2005 Location: New York City
Karma: 0
|
General (1 Star) |
|
|
This is an old bump, I know, but I was browsing the forums to see if there's anything I can make use for myself and I came across this. So I decided to show mine, I'll paste it. Maybe if Exeric still browse these forums, you can make use of it too? You don't have to put the whole player's name.
class ConnectionChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (!Text[1].empty()) {
GameObject *obj;
std::string name = Text[1].c_str();
std::string sender = Get_Player_Name_By_ID(ID);
int amount = 0;
amount = Get_Part_Names(name.c_str());
if (amount == 1) {
obj = Get_Part_Name(name.c_str());
int PID = Get_Player_ID(obj);
name = Get_Player_Name(obj);
if (ID != PID) {
Console_Input(StrFormat("ppage %d Connection for %s -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID,name.c_str(),Get_Ping(PID),Get_Kbits(PID),Get_Bandwidth(PID)).c_str());
}
else {
Console_Input(StrFormat("ppage %d Your connection -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID,Get_Ping(ID),Get_Kbits(ID),Get_Bandwidth(ID)).c_str());
}
}
else if (amount == 0) {
Console_Input(StrFormat("ppage %d Player not found.",ID).c_str());
return;
}
else if (amount > 1) {
obj = Get_GameObj_By_Player_Name(name.c_str());
if (!obj) {
Console_Input(StrFormat("ppage %d There are %i players with that substring, please make the name more unique.",ID,amount).c_str());
return;
}
}
}
else {
Console_Input(StrFormat("ppage %d Your connection -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID, Get_Ping(ID), Get_Kbits(ID), Get_Bandwidth(ID)).c_str());
}
}
};
ChatCommandRegistrant<ConnectionChatCommand> ConnectionChatCommandReg("!ping;!lag",CHATTYPE_ALL,0,GAMEMODE_ALL);
Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.
Part time streamer - https://twitch.tv/gg_wonder
|
|
|
|
|
|
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439325 is a reply to message #439317] |
Fri, 12 November 2010 09:25 |
|
cAmpa
Messages: 597 Registered: March 2006
Karma: 0
|
Colonel |
|
|
Jerad Gray wrote on Fri, 12 November 2010 16:53 |
jnz wrote on Fri, 12 November 2010 05:15 | 2 mem leaks there.
std::string sender = Get_Player_Name_By_ID(ID);
name = Get_Player_Name(obj);
Appropriate changes would be:
const char *sender_cstr = Get_Player_Name_By_ID(ID);
std::string sender(sender_cstr);
delete []sender_cstr;
const char *name_cstr = Get_Player_Name(obj);
name = std::string(name_cstr); //you don't need to explicitly call the ctor as the assignment operator is overloaded. Just added for clarity.
delete []name_cstr;
|
Incorrect, you only have to worry about deleting it if you had new char *, otherwise all the * does is auto allocate the size of the array of chars, and is still cleaned up like any normal variable.
|
Look into Get_Player_Name.
Bückstabü!
|
|
|