Raised This Month: $238 Target: $400
 59% 

Server menu


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   devicenull (200)
Janzert
Senior Member
Join Date: Mar 2004
Old 11-04-2004 , 12:35   Server menu
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (servermenu.sma - 7862 views - 18.2 KB)
__________________
Janzert is offline
Kamikaze
Senior Member
Join Date: Mar 2004
Location: Butler, PA
Old 11-05-2004 , 01:37  
Reply With Quote #2

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 is offline
Send a message via ICQ to Kamikaze Send a message via AIM to Kamikaze Send a message via MSN to Kamikaze Send a message via Yahoo to Kamikaze
Kamikaze
Senior Member
Join Date: Mar 2004
Location: Butler, PA
Old 11-05-2004 , 04:21  
Reply With Quote #3

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.
Kamikaze is offline
Send a message via ICQ to Kamikaze Send a message via AIM to Kamikaze Send a message via MSN to Kamikaze Send a message via Yahoo to Kamikaze
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 11-05-2004 , 05:53  
Reply With Quote #4

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.
__________________

BigBaller is offline
Janzert
Senior Member
Join Date: Mar 2004
Old 11-05-2004 , 15:12  
Reply With Quote #5

@ 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 is offline
Janzert
Senior Member
Join Date: Mar 2004
Old 11-05-2004 , 15:17  
Reply With Quote #6

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
Janzert is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 11-05-2004 , 16:41  
Reply With Quote #7

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.
__________________

BigBaller is offline
team-nsa
Junior Member
Join Date: Oct 2004
Location: Cedar Park, TX
Old 11-06-2004 , 00:31  
Reply With Quote #8

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
team-nsa is offline
Send a message via AIM to team-nsa
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 11-06-2004 , 00:44  
Reply With Quote #9

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.
__________________

BigBaller is offline
team-nsa
Junior Member
Join Date: Oct 2004
Location: Cedar Park, TX
Old 11-06-2004 , 02:16  
Reply With Quote #10

ahh so should the .16 not even work then? or how can it be compatible with .16?
team-nsa is offline
Send a message via AIM to team-nsa
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:55.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode