Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Restart server through client (FIXED)


evilbunnie
 Share

Recommended Posts

Well this is my first ever tut so be nice  :P

Well it is all in the server side

First open server.vbp

now open frmload and find
```
Private Sub Form_Load()
    Me.Show
    Call InitServer
End Sub

```and add under me.show
```
Call PutVar(App.Path & "\restart.ini", "restart", "restart", "0")

```next open frmServer and add one timer and make the interval 500 so the server doesn't lag next double click the timer and add
```
If GetVar(App.Path & "\restart.ini", "restart", "restart") = "1" Then
        Shell ("restart.exe")

        Call PutVar(App.Path & "\restart.ini", "restart", "restart", "0")

Call DestroyServer
        End If

```
Now make a new visual basic project called restart and put what ever you like on in and in formload put

```
Me.Show
Shell ("Server.exe")
End

```

now compile restart to restart.exe
and compile eclipse

Next,
open your main.txt and search for "commands"
now add anywhere in that sub
```
      Case "/rs"
    Call PutVar(App.path & "\restart.ini", "restart", "1")

    exit sub

```Hope that works if it doesn't please tell me!  :azn:

–-evilbunnie---
Link to comment
Share on other sites

@Robin:

> You're not shutting down the server at all, you're just killing it.
>
> Just get the command to boot up the rebooter, then shutdown the server properly.
>
> Have the rebooter loop through until the server has shut down fully, _then_ boot it back up.

Yep, ill try that

EDIT
mmm i just realized this kinda fails  XD
Link to comment
Share on other sites

or you could jsut go,

in client something like

If Casestring = "/reboot" Then
  Call SendData("rebot" & END_CHAR)
End If

Server ModHandleData

Case "reboot"
    Dim a as string, b as long
    For B = 1 to MAX_PLAYERS
        If IsPlaying(b) Then
            Call SavePlayer(b)
        End If
    Next B
    a = shell(App.Path & "Server.exe", vbnormalfocus)
    call DestroyServer
    Exit Sub

that should do the trick. something like that. i cant remember if its casestring or case in the cline tetc. i just did off the top oh head :P
Link to comment
Share on other sites

@[THE-KRIS:

> link=topic=51638.msg542890#msg542890 date=1252579762]
> or you could jsut go,
>
> in client something like
>
> If Casestring = "/reboot" Then
>   Call SendData("rebot" & END_CHAR)
> End If
>
> Server ModHandleData
>
> Case "reboot"
>     Dim a as string, b as long
>     For B = 1 to MAX_PLAYERS
>         If IsPlaying(b) Then
>             Call SavePlayer(b)
>         End If
>     Next B
>     a = shell(App.Path & "Server.exe", vbnormalfocus)
>     call DestroyServer
>     Exit Sub
>
> that should do the trick. something like that. i cant remember if its casestring or case in the cline tetc. i just did off the top oh head :P

Wait so instead of killing the client  should of just typed destroy server sorry i am a real retard when it comes to eclipse

Thanx for ur help :)

EDIT Done i changed the mainpost but i think your  ways better lol but would i be able to like put that in my main.txt in commands like

Case "/rs"
    Dim a as string, b as long
    For B = 1 to MAX_PLAYERS
        If IsPlaying(b) Then
            Call SavePlayer(b)
        End If
    Next B
    shell(App.Path & "Server.exe", vbnormalfocus)
    call DestroyServer
    Exit Sub
Link to comment
Share on other sites

no thats in teh server side.

ermmm.. what i dont understand XD

Case "reboot"
    Dim a as string, b as long
    For B = 1 to MAX_PLAYERS
        If IsPlaying(b) Then
            Call SavePlayer(b)
        End If
    Next B
    a = shell(App.Path & "Server.exe", vbnormalfocus)
    call DestroyServer
    Exit Sub

would go into

Server, ModHandleData

the client bit would go into wherever the bit that handles commands is on the client. make sure its in teh bit that checks if your the owenr though.
Link to comment
Share on other sites

@[THE-KRIS:

> link=topic=51638.msg542892#msg542892 date=1252580108]
> no thats in teh server side.
>
> ermmm.. what i dont understand XD
>
> Case "reboot"
>     Dim a as string, b as long
>     For B = 1 to MAX_PLAYERS
>         If IsPlaying(b) Then
>             Call SavePlayer(b)
>         End If
>     Next B
>     a = shell(App.Path & "Server.exe", vbnormalfocus)
>     call DestroyServer
>     Exit Sub
>
> would go into
>
> Server, ModHandleData
>
> the client bit would go into wherever the bit that handles commands is on the client. make sure its in teh bit that checks if your the owenr though.

Yeah ok then
XD
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...