A public OGC server is running at ogc.yz.to:11111. If you want to run your own OGC server you can download it.
To use the OGC protocol in a Java application you can use the OGC Java library. To use it in other programs refer to the OGC protocol:
You have to set up an UDP socket to receive and send commands to the Open Game Cache server. The OGC server will send all answers back to the client port from which the client has sent something to the server.
To put a game on the OGC server list you have to open an UDP socket
and send the GAME: command to the OGC server. You have to
keep the UDP socket open as long as you want your game to be in the list.
To delete your game from the list use the QUIT: command.
The OGC server will delete your game automatically when it does not
receive an update for 30 minutes.
For browsing the list you send the command LISTGAMES:
followed by the name of your game to the OGC server. The
OGC server will start sending a list of hosted games to your UDP
socket from where you have sent this command. Note that you only
get a list of games you asked for. So if you send
LISTGAME:tetris you won't get the other games.
After the OGC server finished sending the list, your client will be put
on the browsing game list and receive further updates for 10 minutes
about games that are added to the list in this period or that are being
removed.
To make sure the browsing client won't get any updates or
to delete the browsing client from the list the client has to send
LISTQUIT: to the OGC server.
All commands are followed by a :. After that you can put
the parameters seperated by a tab. Example for c:
sprintf (senddata, "GAME:BomberClone\t0.11.0\tSteffen's Game\tIPv6\t3\t\8\tWaiting");
sprintf (senddata, "QUIT:");
In the following command specification "string" means a sequence of bytes and "char" means a byte. Use ASCII only (0 - 127) to make it look the same in all charsets!
Add the game to the OGC list or update the game in the list.
| Parameter | Comments |
| Game | Name of the game (i.e. BomberClone, Tetris..) |
| Version | Versionsnumber of the Game. The OGC saves the first 12 chars of this string (i.e. 0.11.0p1) |
| Netname | Name of the network game. (i. e. Steffen's Game) |
| Nettype | Network type you use followed by the portnumber.
Possible values are: TCP4:Port - TCP/IP Game (i.e. TCP4:5403) TCP6:Port - TCP/IP Game using IPv6 (the new internet protocol, i.e. TCP6:5403) UDP4:Port - UDP/IP Game (i.e. UDP6:5403) UDP6:Port - UDP/IP Game using IPv6 (the new internet protocol, i.e. UDP6:5403) IPv4 - old parameter for UDP games using IPv4. The port will be got from the OGC Client UDP port. (i.e. IPv4) IPv6 - old parameter for UDP games using IPv6. The port will be got from the OGC Client UDP port. (i.e. IPv6) |
| curplayers | Current number of players |
| maxplayers | Maximum number of players |
| status | can hold any information which fits in 6 chars to inform the client if the game is closed, joinable, updateing, running and so on |
Delete the game from the OGC list. You do not need to supply the command with the parameters to delete just any game from your host. The parameters are needed if you are running more game on one mashine.
| Parameter | Comments |
| Game | Name of the game (i.e. BomberClone, Tetris..) |
| Netname | Name of the network game. (i. e. Steffen's Game) |
Add the OGC client to the browsing/watching game list for the specified game.
| Parameter | Comments |
| Game | Name of the game you want to have a list from. |
Add the OGC client to the browsing/watching game list.
| Parameter | Comments |
Delete the OGC client from the browsing list. This will stop the OGC server from sending a list to the OGC client.
| Parameter | Comments |
Game information.
| Parameter | Comments |
| IDnum | Id of the game in the list. Every game which is added will get a ID to identify the game in the list. |
| Host | Hostname where the game is running. |
| Port | Portnumber where the game is running. |
| Game | Name of the Game |
| Version | Version of the game. |
| Nettype | Type of network what is used. TCP4, TCP6, UDP4, UDP6 - protocol what is used for the game IPv4, IPv6 - old style for UDP games. |
| Netname | Name of the network game (i.e. Steffen's Game |
| Status | Status of the game |
| CurPlayers | Current number of players |
| MaxPlayers | Maximum number of players |
Information that a game got deleted.
| Parameter | Comments |
| IDnum | the id number of the deleted game in the list. |