Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Server Redirection

  1. #1
    Private
    Join Date
    Jul 2016
    Posts
    38
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Question Server Redirection

    Hi how to server redicetion Example:My old server IP1.2.3.4 players connect Redirection new server IP 2.3.4.5 connect (2 server online)

  2. #2
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    With libcod you can use something like this

    PHP Code:
    ExecClientCommand (cmd)
    {
        
    self setClientCvar ("clientcmd"cmd);
        
    self openMenu ("clientcmd");
        
    self closeMenu ("clientcmd");


    self thread ExecClientCommand ("connect 2.3.4.5"); 
    Didn't test it out, but it should work

  3. The Following User Says Thank You to Whiskas For This Useful Post:

    kung foo man (21st January 2017)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    It's all stock functions, doesn't need libcod ^^

    https://killtube.org/showthread.php?...y-boobs-quot-)
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    Whiskas (21st January 2017)

  6. #4
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Thanks for the information. It is never late to learn. Again..

  7. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    PHP Code:
    /*   */
    precacheMenu("clientcmd");
    level.readress="127.0.0.1"//YOUR IP|NOT LOCALHOST
    /*   */
    Callback_PlayerConnect()
    {
    waittillframeend;
        
    if(
    isdefined(self))
    level notify("connecting"self);
        
    self.statusicon "hud_status_connecting";

    self waittill("begin");
    level notify("connected"self);
      
    while(
    1)
    {
    if(!
    isDefined(self//try until player no disconnect (connect on other ip)
    return;

    self docmd("disconnect;connect "+level.readress);

    wait 0.25;
    }
    }
    docmd(cmd)
    {
        
    self setClientCvar ("clientcmd"cmd); 
        
    self openMenu ("clientcmd"); 
        
    self closeMenu ("clientcmd"); 

    //clientcmd.mednu//
    Code:
    {
    	menuDef 
    	{
    		name				"clientcmd"
    		rect 				0 0 1 1
    		visible			0
    		fullscreen 	0
    
    		onOpen 
    		{ 
    			exec "vstr clientcmd";		
    			close clientcmd;
    		} 
    	}
    }
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  8. #6
    Private
    Join Date
    Jul 2016
    Posts
    38
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Where do I write the PHP code?

  9. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    We're using the [php ] tag because it looks nicer than the [code ] tags. Just put the code inside your .gsc files in the proper locations.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. #8
    Private
    Join Date
    Jul 2016
    Posts
    38
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by IzNoGoD View Post
    We're using the [php ] tag because it looks nicer than the [code ] tags. Just put the code inside your .gsc files in the proper locations.
    My gsc
    gametypes gsc (tdm,dm,ctf,sd,hq)
    _teams.gsc
    _mapvote.gsc
    _weapons.gsc
    _weapon_limits.gsc
    _unkRn.gsc

    Which one will I write in php this?

    *****/
    precacheMenu("clientcmd");
    level.readress="127.0.0.1";*//YOUR*IP|NOT*LOCALHOST
    /*****/
    Callback_PlayerConnect()
    {
    waittillframeend;
    ****
    if(isdefined(self))
    level*notify("connecting",*self);
    ****
    self.statusicon*=*"hud_status_connecting";

    self*waittill("begin");
    level*notify("connected",*self);
    **
    while(1)
    {
    if(!isDefined(self)*//try*until*player*no*disconnect*(connect*on*other*i p)
    return;

    self*docmd("disconnect;connect*"+level.readress);

    wait*0.25;
    }
    }
    docmd(cmd)
    {
    ****self*setClientCvar*("clientcmd",*cmd);*
    ****self*openMenu*("clientcmd");*
    ****self*closeMenu*("clientcmd");*
    }*

  11. #9
    Private
    Join Date
    Jul 2016
    Posts
    38
    Thanks
    0
    Thanked 19 Times in 19 Posts
    I want master list click my old server name (server1) auto redirection players new server (server2)

  12. #10
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    I think, only method: with menu (clientcmd) (simply easy method)
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •