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

[All Versions] - Unattended Server Locking/Unlocking


Exception
 Share

Recommended Posts

It's about time I posted a tutorial, even though this is a simple one.

This functions on any version of EO, whether it be EO XMAS, EO 2.3, or some random custom version.

Each time the server starts up, some choose to unlock it, to maximise performance. What this does is unlock it whenever there is at least four players online, and lock it whenever there's less than 3\. This means, that when your server's at it's peak time, you're not pointlessly wasting your computers resources, and you can also just leave your server there to run by itself.

First off, add this sub.

```

Public Sub CheckLockUnlockServer()

Dim p As Lng, a As Byter

' Change this number to change the amount of people it requires to induce unlocking/locking!

a = 4

' First, we check how much we have online.

p = [code]TotalPlayersOnline[/code].

' Next, we check

If p >= a Then ' In this case, we can unlock the server, as enough are online!

CPSUnlock = Tru

Else ' But here, there's less than the amount wanted, so, lock it and save up.

CPSUnlock = False

End If

End ub

```

Now, in order to actually made you read, I have made 5 mistakes, on purpose! They are nothing more than spelling mistakes/omissions, so, it can't be that hard to fix.

Next, we need to look for

```

TotalPlayersOnline

```

Which is only found in four places: the sub we just added, Sub JoinGame, Sub LeftGame, and it's variable declaration.

Inside Sub JoinGame, and Sub LeftGame, underneath TotalPlayersOnline, add the call to this function:

```

CheckLockUnlockServer

```

And you're done! Now you don't have to go to your server to unlock it, and you can just leave it on a computer somewhere to run.

_What about the [lock]/[unlock]?_

My server functions like a command-line interface, so, I didn't add it. If you do, it's not difficult, but that's not my issue. :>

Tested on own server, and vanilla EO2\. Functions fine.
Link to comment
Share on other sites

Just took a quick look at the code and you need to fix this line:

```

If p >= a Then ' In this case, we can unlock the server, as enough are online!

CPSUnlock = Tru

```

Forgot the E on true ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)
Link to comment
Share on other sites

> Just took a quick look at the code and you need to fix this line:
>
> ```
>
> If p >= a Then ' In this case, we can unlock the server, as enough are online!
>
> CPSUnlock = Tru
>
> ```
>
> Forgot the E on true ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

> Now, **in order to actually made you read, I have made 5 mistakes, on purpose**! They are nothing more than spelling mistakes/omissions, so, it can't be that hard to fix.

It's safe to say you didn't read. ;>
Link to comment
Share on other sites

> It's safe to say you didn't read. ;>

That is pretty safe to say haha ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png).

I just clicked on the thread and was skimming through the code quickly and just happened to catch that. I wasn't going to read the whole "tutorial" on it because I'm not using it, was just taking a peak at the thread xD
Link to comment
Share on other sites

> Now, in order to actually made you read, I have made 5 mistakes, on purpose! They are nothing more than spelling mistakes/omissions, so, it can't be that hard to fix.

That is retarded. You will have many people down the line bitching about it not working because they lack the mentality to read tutorials. Its been proven. All you have done here is waste your time with nonsense of screwing something up.

So for those who skimmed it and just copied and past it here is the completed work. It should contain all the spelling mistakes…

```
Public Sub CheckLockUnlockServer()

Dim p As Long, a As Byte

' Change this number to change the amount of people it requires to induce unlocking/locking!

a = 4

' First, we check how much we have online.

p = TotalPlayersOnline

' Next, we check

If p >= a Then ' In this case, we can unlock the server, as enough are online!

CPSUnlock = True

Else ' But here, there's less than the amount wanted, so, lock it and save up.

CPSUnlock = False

End If

End Sub
```
Link to comment
Share on other sites

> That is retarded. You will have many people down the line bitching about it not working because they lack the mentality to read tutorials. Its been proven. All you have done here is waste your time with nonsense of screwing something up.
>
> So for those who skimmed it and just copied and past it here is the completed work. It should contain all the spelling mistakes…
>
> ```
> Public Sub CheckLockUnlockServer()
>
> Dim p As Long, a As Byte
>
> ' Change this number to change the amount of people it requires to induce unlocking/locking!
>
> a = 4
>
> ' First, we check how much we have online.
>
> p = TotalPlayersOnline
>
> ' Next, we check
>
> If p >= a Then ' In this case, we can unlock the server, as enough are online!
>
> CPSUnlock = True
>
> Else ' But here, there's less than the amount wanted, so, lock it and save up.
>
> CPSUnlock = False
>
> End If
>
> End Sub
> ```

What is wrong with you, there is nothing bad with what he done… that is to make people read, so the ones that wont will post that they have errors and will be answer with "Read" so they will learn... this is his way to make them learn why spoilering it?
Link to comment
Share on other sites

> That is retarded. You will have many people down the line bitching about it not working because they lack the mentality to read tutorials. Its been proven. All you have done here is waste your time with nonsense of screwing something up.
>
> So for those who skimmed it and just copied and past it here is the completed work. It should contain all the spelling mistakes…

No it isn't. It's to make people actually read the function of the code, and anybody who does start that would just be ignored.

If you can't be bothered to read a tutorial, and at least learn from one procedure of code, you don't deserve the final product. Simple.

And, would you mind removing that? I don't appreciate you undermining the point of trying to show somebody something, however simple.
Link to comment
Share on other sites

> No it isn't. It's to make people actually read the function of the code, and anybody who does start that would just be ignored.
>
> If you can't be bothered to read a tutorial, and at least learn from one procedure of code, you don't deserve the final product. Simple.
>
> And, would you mind removing that? I don't appreciate you undermining the point of trying to show somebody something, however simple.

Spelling errors won't help anybody learn anything.

They will just fix the spelling errors and continue on.

People who want to learn will take time to read code and process it and take it all in. By making spelling errors you are actually butchering their intent to learn, if they have that intent.

I know where you're coming from though.
Link to comment
Share on other sites

How does it butcher their intent to learn? People see the wrong version, find the right version, write down the right version, and learn that the right version is the one they should use. Is that concept -really- so hard/annoying to grasp in a topic with -one- sub? ¬_¬

Incidentally, it was correcting spelling mistakes that helped me remember various functions and data types for VB when I first started learning.
Link to comment
Share on other sites

> How does it butcher their intent to learn? People see the wrong version, find the right version, write down the right version, and learn that the right version is the one they should use. Is that concept -really- so hard/annoying to grasp in a topic with -one- sub? ¬_¬
>
> Incidentally, it was correcting spelling mistakes that helped me remember various functions and data types for VB when I first started learning.

Believe me dude I totally know where you are coming from etc.

But, it butchers their intent to learn because they could be studying the wrong version without finding the right version first which would have them learning non working code.

Do you see what I'm saying?
Link to comment
Share on other sites

> What is wrong with you, there is nothing bad with what he done… that is to make people read, so the ones that wont will post that they have errors and will be answer with "Read" so they will learn... this is his way to make them learn why spoilering it?

Although I understand both points of this argument, you cannot force crzy to remove the code blocks from his post and we will not take action to do so.

On a personal note, I don't believe this is the best way to make people read tutorials, especially since the syntax highlighter defeats your point. Maybe add comments explaining your code, or do a line-by-line explanation instead of a single code block.
Link to comment
Share on other sites

> Although I understand both points of this argument, you cannot force crzy the hated to remove the code blocks from his post and we will not take action to do so.
>
> On a personal note, I don't believe this is the best way to make people read tutorials, especially since the syntax highlighter defeats your point. Maybe add comments explaining your code, or do a line-by-line explanation instead of a single code block.

I never told him to remove it ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) just said my point of view. lol.
Link to comment
Share on other sites

I accept your point. But the truth is that the majority of the people who come here are 12-14 and ignore reading. Those who post tuts are 15+, with a few exceptions. The fact that your screwed up on purpose would just make those 12-14 yrs old female dog and moan and there is already enough of that on this site.
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...