AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Server menu (https://forums.alliedmods.net/showthread.php?t=7347)

Janzert 11-04-2004 11:35

Server menu
 
1 Attachment(s)
This gives an in game menu that will allow players to query and connect to other servers if wanted.

To set the list of servers available, create a file serverlist.cfg in the amxx config directory. Each line should contain one server and look like:

Server name\IP or hostname:port password

Server name is whatever you want the server to be called in the menu. That is followed by a backslash (\). Then the hostname or IP of the server followed by a colon (:) and then the port. If needed the password is put after a space following the port. Warning, this will allow anyone that uses the menu to connect to the passworded server to learn the password.
The port and password are optional. The port will default to 27015 and must be defined if a password is used.

Lines starting with # or ; are considered a comment.

1.0
Some small refactoring to clean up the code a bit.
Fixed a bug where it would not handle a challenge with a 0x00 byte in it.
Unfortunately this uncovered a similiar bug in the sockets module. So...
Added a little more graceful handling of packet errors.

0.6
Update to new steam server query protocol.

0.5
Changed the way packets are formed to be sent. Hopefully working around the linux compiler bug and also being 64bit compliant. (Suggested by Bailopan.)

0.4:
Fixed showing incorrect number of pages on the main server menu.

0.3:
Changed includes to conform with standard practice
Made the port optional in the server list
Added ability to connect to password protected servers

0.2:
Initial public release

Kamikaze 11-05-2004 00:37

Code:

#include <amxmodx.inc>
#include <file.inc>
#include <string.inc>
#include <amxmisc.inc>
#include <sockets.inc>

You don't need the .inc part in there, make it this (looks cleaner):

Code:

#include <amxmodx>
#include <file>
#include <string>
#include <amxmisc>
#include <sockets>

First plugin I've seen use the Sockets Module, I think I could make use for this plugin. My clan members always go from server to server, this will become popular on my servers, thanks for the plugin.

Kamikaze 11-05-2004 03:21

Bug Found, not sure if this is fixable:

You can't connect to a HLTV, even if it's the same mod you were just on.

It's weird issue because you can connect by typing Connect IP:port but it doesn't work.

It shows the error: Can't connect to Server.

BigBaller 11-05-2004 04:53

Acutally to make the code nicer you just need

Code:
#include <amxmodx> #include <amxmisc> #include <sockets>

The file.inc and string.inc are already included in the amxmodx.inc soo adding them into your plugin is kinda pointless.

However, I must say this has to be one of the best ideas for a plugin ever, I will try this out on my server and add a few servers that I know of to test this out.

And have you thought about adding a option to place passwords in the config file?

something like ip addy\pass\port
which the pass part would be optional so you can still have
ip addy\port

or maybe you do
ipaddy:port password=blah

or something I dont know, just giving you something to think about :)

EDIT

You should change your include files too
Code:
#include <amxmodx> #include <amxmisc> #include <sockets>

That is the "correct" way for your plugin to compile. If you do that then everything will work fine, cause right now your plugin doesnt compile with the online compiler.

Janzert 11-05-2004 14:12

@ kamikaze

Are you sure the server line in serverlist.cfg is correct? It seems to work fine here.

@ Bigballer

I had thought about adding passwords before but didn't think people would want to expose their passwords. I went ahead and did it, with the warning that any one who uses it will be able to learn the password.

Janzert

Janzert 11-05-2004 14:17

Still doesn't seem to compile with the web compiler. :(

Any way to see what the errors are? Does the web compiler have sockets.inc?

Janzert

BigBaller 11-05-2004 15:41

It should

If not then maybe you should contact BAILOPAN or post in the bugs forum about the web compiler not reading the sockets.inc

I installed the plugin last night, works very well, good job.

team-nsa 11-05-2004 23:31

I get a /home/users/amxmodx/tmp/phpk7hh7c.sma(59) : fatal error 100: cannot read from file: "sockets"

Compilation aborted.
1 Error.

when i compile this plugin

BigBaller 11-05-2004 23:44

you need the sockets module to use this plugin.

Seeing how the sockets module is only on .20 amxx you need to use the nightly builds in order to compile this plugin.

team-nsa 11-06-2004 01:16

ahh so should the .16 not even work then? or how can it be compatible with .16?


All times are GMT -4. The time now is 20:07.

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