AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] New IP Redirect (v1.1.0, 3-27-14) (https://forums.alliedmods.net/showthread.php?t=153769)

Bubka3 03-28-2011 21:59

[Any] New IP Redirect (v1.1.0, 3-27-14)
 
[Any] New IP Redirect (v1.1.0, 3-27-14)

Description: This plugin can be placed on your server to redirect players to your new server.

CVAR / Command List:
  • sm_redirect_newip - Set to your new IP. (Default 0.0.0.0)
  • sm_redirect_kicktimer - Seconds to kick after not leaving. (Default 120)
  • sm_redirect_showtimer - Seconds to show connection display box. (Default 120)
Installation: Place the newipredirect.smx into addons/sourcemod/plugins and the cvars into your server.cfg.

Reporting Issues
Please open a new issue for any bugs here. Please don't use this area for general support, that belongs in this thread.

Change Log:
v1.1.0, 3-27-14
* General clean up of plugin and post.
* Made kick message more understandable.
v1.0.1, 3-25-13
* Removed useless string (thanks Dr!fter).
* Updated to new website. :)
v1.0, 3-28-11
* Initial release.

Special Thanks:
Monkey, and twistedpanda. They helped me basically put this together. I have gotten a lot more advanced since that time.

Download the Plugin (newipredirect.smx)
View the Source (newipredirect.sp)

nightrider 03-30-2011 18:19

Re: [B3] New IP Redirect (v1.0, 3-28-11)
 
Interesting, thanks for sharing.

deathcurse 12-01-2011 12:15

Re: [B3] New IP Redirect (v1.0, 3-28-11)
 
Good plugin, helping us move players over to our new servers. :)

Thanks!

Dr!fter 12-28-2012 11:26

Re: [B3] New IP Redirect (v1.0, 3-28-11)
 
Nice plugin.

PHP Code:

public EventSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl String:buffer[32];
    
GetConVarString(NewIPbuffersizeof(buffer));
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
Float:time GetConVarFloat(STime); 
    new 
String:ip[32]; 
    
GetConVarString(NewIPipsizeof(ip));
    
DisplayAskConnectBox(clienttimeip);
    
PrintToChat(client"[SM] We have a new server at IP: %s"ip);
    
PrintToChat(client"[SM] Press F3 to connect to the new server.");
    
PrintToChat(client"[SM] If you do not connect, you will be kicked from this server.");


You declare buffer and set its value but never use it you then grab the same value but store it in ip so remove the buffer one. Other than that looks good and approved!

Bubka3 03-25-2013 00:41

Re: [B3] New IP Redirect (v1.0, 3-28-11)
 
Quote:

Originally Posted by Dr!fter (Post 1861923)
You declare buffer and set its value but never use it you then grab the same value but store it in ip so remove the buffer one. Other than that looks good and approved!

Whoops, might be 2 years late, but fixed.

Donski 04-13-2013 12:53

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
What if our server is not on the default port 27015? Will it use the same port or can we set it using the re_newip cvar (eg. 0.0.0.0:27016)?

Thanks!

Donski 04-13-2013 19:50

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Hmm, it shows the notice but pressing F3 doesn't seem to do anything. F3 is binded to askconnect_accept. Any thoughts? :\

Also getting these errors:

Code:

L 04/14/2013 - 07:56:43: [SM] Native "CloseHandle" reported: Handle 1e300e3 is invalid (error 3)
L 04/14/2013 - 07:56:43: [SM] Displaying call stack trace for plugin "bub_redirect.smx":
L 04/14/2013 - 07:56:43: [SM]  [0]  Line 35, /home/groups/alliedmodders/forums/files/6/8/6/3/1/117612.attach::OnClientDisconnect()


me-Shoe 04-14-2013 08:53

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Is this Plugin still up to date (protobuf and so) and approved with CS:GO?

vodka00 04-27-2013 14:04

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Nice plugin. I think anyone with admin flag shouldn't get kicked.

narugo 05-24-2013 21:07

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
How to protect admins and bots, and set maxslots like redirector. smx or hreserved_slots?

I liked more this plugin because this function "re_stime" keep box asking to a new server.

me-Shoe 07-10-2013 17:28

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Ok. Its not working for CSGO! ;)

fiala06 07-24-2013 18:37

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Yeah F3 to connect isn't working for me either.

Catwoman 09-21-2013 01:23

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Quote:

Originally Posted by Donski (Post 1931997)
What if our server is not on the default port 27015? Will it use the same port or can we set it using the re_newip cvar (eg. 0.0.0.0:27016)?

Thanks!

anyone got a solution for this issue? i love that pluggy, but the default port of my new server isn't 27015. :cry:

Catwoman 09-22-2013 01:46

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
Quote:

Originally Posted by Catwoman (Post 2038272)
anyone got a solution for this issue? i love that pluggy, but the default port of my new server isn't 27015. :cry:

i can simply add the port to the ip. and it works. nifty pluggy. thx :fox:

nightrider 12-16-2013 20:14

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
plugin works very well.
Thank you.

Syranolic 01-06-2014 08:10

Re: [B3] New IP Redirect (v1.0.1, 3-25-13)
 
1 Attachment(s)
I needed an extra feature: show the reconnect dialog only when the server is getting full (and the possibility to disable the kick). So I added that. I also fixed a bug (edit: reported by Donski) with the timer: it should be "killed", not "closed".

But the most important part, I think, was that the message comes up too early. It is confusing since it is not possible to press F3 before the player is in the game (chosing a class or joining spectators).
(edit: I did this for TF2, I have no idea if I broke the plugin for other games!)

St00ne 04-17-2014 09:17

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Hi,

The plugin works fine but the sourcecode doesn't seem right, because if I compile it now, I get a message to be redirected to an IP with a slash at the end:
like 127.0.0.1/ instead of 127.0.01
I don't know why. Maybe I need the latest compiler, I only have the 1.5.2 for now.
EDIT: this not a problem because the redirection works :mrgreen::fox:
Anyway thx for this plugin, some similar plugins don't work anymore but this one is fine.
Game: CS:S

++

St00ne

St00ne 04-17-2014 10:10

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
oops, wrote too quick: I get an error log : (

Code:

L 04/17/2014 - 14:13:38: [SM] Native "KillTimer" reported: Invalid timer handle 73810b43 (error 3)
L 04/17/2014 - 14:13:38: [SM] Displaying call stack trace for plugin "newipredirect.smx":
L 04/17/2014 - 14:13:38: [SM]  [0]  Line 35, C:\Users\Artie\Downloads\newipredirect.sp::OnClientDisconnect()


taRik 04-17-2014 10:38

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Doesn't work for CSGO I assume?

St00ne 04-17-2014 11:23

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
1 Attachment(s)
Quote:

Originally Posted by St00ne (Post 2125860)
oops, wrote too quick: I get an error log : (

Code:

L 04/17/2014 - 14:13:38: [SM] Native "KillTimer" reported: Invalid timer handle 73810b43 (error 3)
L 04/17/2014 - 14:13:38: [SM] Displaying call stack trace for plugin "newipredirect.smx":
L 04/17/2014 - 14:13:38: [SM]  [0]  Line 35, C:\Users\Artie\Downloads\newipredirect.sp::OnClientDisconnect()


Error fixed + added a check: if sm_redirect_kicktimer is set to 0, players aren't kicked.
+ added a password cvar, though it was not mandatory from what I read.

++

St00ne 04-21-2014 22:51

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Quote:

Originally Posted by taRik (Post 2125882)
Doesn't work for CSGO I assume?

The box on the top left displaying the new ip and asking you to accept redirection, does not appear on CSGO.
Only the chat message is displayed.

If someone can find a replacement for the stock: DisplayAskConnectBox(client, Float:time, const String:ip[], const String:password[] = "")
...that would be great.

++

asdfdsdf 08-29-2014 11:45

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Does this work also for cs go would be nice ?

mlov420 09-05-2014 05:33

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
No. This shouldn't work for CSGO since there is no "ask connect" feature in CSGO. It will display text in chat as if it's moving the player to a new server, but it never happens.

Manius1988 03-27-2015 14:33

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
CS:GO?

Mitchell 03-27-2015 15:14

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Quote:

Originally Posted by Manius1988 (Post 2278753)
CS:GO?

Read the post directly above yours.

Deven 05-27-2015 13:42

Re: [Any] New IP Redirect (v1.1.0, 3-27-14)
 
Quote:

Originally Posted by St00ne (Post 2127821)
The box on the top left displaying the new ip and asking you to accept redirection, does not appear on CSGO.
Only the chat message is displayed.

If someone can find a replacement for the stock: DisplayAskConnectBox(client, Float:time, const String:ip[], const String:password[] = "")
...that would be great.

++



All times are GMT -4. The time now is 21:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.