View Single Post
Author Message
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 02-20-2011 , 04:58   Fully Threaded Server Redirect
Reply With Quote #1

Summary

This is a fully threaded version of Brainstorm's popular Server Redirect.
http://forums.alliedmods.net/showthread.php?p=736131

I had to fix it because if your database goes down or becomes unreachable, ALL YOUR SERVERS WILL FREEZE which is absolutely horrible and unusable in my opinion.

I was going to post it in the same thread, but I feel like I changed too much of it to be fully compatible.

How to install

Follow brainstorm's instructions except:
  • The default database used is default instead of serverredirect
  • Put your configurations in server.cfg instead of plugin.serverredirect.cfg (makes it possible to run multiple servers on 1 directory)
  • Or put "exec sourcemod/plugin.serverredirect" in server.cfg if you don't do the step above.


Changelog

  • Removed the unneeded include line.
  • Prevent players from submitting multiple requests before the first one finishes.
  • Fixed the database connection leak due to sourcemod bug.
  • Added a 5 second cache for player requests.
  • Fixed updates by putting quotes on the map name.
Differences
  • Fully Threaded.
  • Removed the ugly chat hook and turned it into a standard RegConsoleCmd.
  • Ripped out the translations because I am a 0-config kind of person and I was annoyed when I forgot to upload the translation file and I refused to change the map just to get it to reload.
  • Ripped out the natives because no one uses them anyway, and it would've taken me several more hours to thread those.
  • Bots count as taking up a slot.
  • Changed default database to "default"
  • Removed usage of config file at "plugin.serverredirect". It conflicts with running multiple servers with 1 directory.
TODO
  • Cancel the threaded query if a player logs off before it finishes. (I don't know how to do this)
Attached Files
File Type: txt mysql_new_install.sql.txt (1.2 KB, 1945 views)
File Type: sp Get Plugin or Get Source (serverredirect.sp - 3402 views - 15.1 KB)
__________________

Last edited by bottiger; 08-24-2011 at 20:30.
bottiger is offline