Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Plug-in] SSGM2.02 Ping Plugin  () 1 Vote
[Plug-in] SSGM2.02 Ping Plugin [message #381102] Sat, 18 April 2009 14:28 Go to next message
ExEric3 is currently offline  ExEric3
Messages: 743
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 #381161 is a reply to message #381102] Sat, 18 April 2009 17:14 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
That's pretty cool. Can I suggest that maybe for !ping <playername> you use try to get part of there name and base it on that? So that !ping reb0 might work...

Nice effort man, congrats on the release! Smile



Re: [Plug-in] SSGM2.02 Ping Plugin [message #381179 is a reply to message #381161] Sat, 18 April 2009 18:15 Go to previous messageGo to next message
ExEric3 is currently offline  ExEric3
Messages: 743
Registered: February 2005
Location: Slovakia
Karma: 0
Colonel
reborn wrote on Sun, 19 April 2009 02:14

That's pretty cool. Can I suggest that maybe for !ping <playername> you use try to get part of there name and base it on that? So that !ping reb0 might work...

Nice effort man, congrats on the release! Smile


Yeah I try it before but it never works for me. I get only errors or crashes. Whats That
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395907 is a reply to message #381102] Wed, 22 July 2009 09:33 Go to previous messageGo to next message
silentevil is currently offline  silentevil
Messages: 94
Registered: April 2005
Location: Germany Hamburg
Karma: 0
Recruit

plugin not inside ...
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395911 is a reply to message #395907] Wed, 22 July 2009 09:57 Go to previous messageGo to next message
ExEric3 is currently offline  ExEric3
Messages: 743
Registered: February 2005
Location: Slovakia
Karma: 0
Colonel
Miklo wrote on Wed, 22 July 2009 18:33

plugin not inside ...


Edited. Thx
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395916 is a reply to message #381102] Wed, 22 July 2009 11:29 Go to previous messageGo to next message
Nightma12 is currently offline  Nightma12
Messages: 2593
Registered: August 2003
Karma: 0
General (2 Stars)
Category Moderator
Why code this when both BR *AND* NR include these features by default?

Seems a bit redundant and reinventing the wheel?
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395917 is a reply to message #381102] Wed, 22 July 2009 11:33 Go to previous messageGo to next message
raven
Messages: 595
Registered: January 2007
Location: Toronto, Ontario
Karma: 0
Colonel
What if you don't use those? Sarcasm

-Jelly Administrator
-Exodus Administrator
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395924 is a reply to message #395916] Wed, 22 July 2009 11:55 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
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.
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395928 is a reply to message #381102] Wed, 22 July 2009 12:06 Go to previous messageGo to next message
silentevil is currently offline  silentevil
Messages: 94
Registered: April 2005
Location: Germany Hamburg
Karma: 0
Recruit

in nr dont work ,,,
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395940 is a reply to message #395916] Wed, 22 July 2009 15:26 Go to previous messageGo to next message
ExEric3 is currently offline  ExEric3
Messages: 743
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 #395944 is a reply to message #381102] Wed, 22 July 2009 17:26 Go to previous messageGo to next message
silentevil is currently offline  silentevil
Messages: 94
Registered: April 2005
Location: Germany Hamburg
Karma: 0
Recruit

ping in NR
Re: [Plug-in] SSGM2.02 Ping Plugin [message #395961 is a reply to message #395924] Wed, 22 July 2009 22:33 Go to previous messageGo to next message
Nightma12 is currently offline  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 #395980 is a reply to message #381102] Thu, 23 July 2009 03:54 Go to previous messageGo to next message
silentevil is currently offline  silentevil
Messages: 94
Registered: April 2005
Location: Germany Hamburg
Karma: 0
Recruit

in nr only works lag maby you can add ping !ping !lag

greatzs....

[Updated on: Thu, 23 July 2009 04:29]

Report message to a moderator

Re: [Plug-in] SSGM2.02 Ping Plugin [message #396039 is a reply to message #381102] Thu, 23 July 2009 19:36 Go to previous messageGo to next message
dr3w2 is currently offline  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 #396081 is a reply to message #381102] Fri, 24 July 2009 04:14 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

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.

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396088 is a reply to message #396081] Fri, 24 July 2009 05:31 Go to previous messageGo to next message
Goztow is currently offline  Goztow
Messages: 9718
Registered: March 2005
Location: Belgium
Karma: 12
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 Go to previous messageGo to next message
dr3w2 is currently offline  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 #396225 is a reply to message #396222] Sat, 25 July 2009 15:14 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
andr3w282 wrote on Sat, 25 July 2009 22:56

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


It's because it's the example plugin source and his changes aren't even in there.
Re: [Plug-in] SSGM2.02 Ping Plugin [message #396226 is a reply to message #381102] Sat, 25 July 2009 15:16 Go to previous messageGo to next message
dr3w2 is currently offline  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 #396228 is a reply to message #396226] Sat, 25 July 2009 15:30 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
andr3w282 wrote on Sat, 25 July 2009 23:16

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.


Meh, I just opened Plugin.cpp and had a look.
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439290 is a reply to message #381102] Fri, 12 November 2010 00:41 Go to previous messageGo to next message
Xpert is currently offline  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);


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

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 #439296 is a reply to message #381102] Fri, 12 November 2010 02:45 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Did you use my code as an example? I think I fixed the bug in get_part_names for that to work, you should post that too. Smile

Good effort! Smile



Re: [Plug-in] SSGM2.02 Ping Plugin [message #439301 is a reply to message #381102] Fri, 12 November 2010 05:15 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
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;


Re: [Plug-in] SSGM2.02 Ping Plugin [message #439317 is a reply to message #439301] Fri, 12 November 2010 08:53 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
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.


Re: [Plug-in] SSGM2.02 Ping Plugin [message #439325 is a reply to message #439317] Fri, 12 November 2010 09:25 Go to previous messageGo to previous message
cAmpa is currently offline  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ü!
Previous Topic: [skin] Skittles Stealth Effect
Next Topic: [Skins] Duke 3D doors
Goto Forum:
  


Current Time: Sun Apr 28 09:13:58 MST 2024

Total time taken to generate the page: 0.01530 seconds