1, what is ODK? The full name of ODK is Othello Development Kit, which is used to develop to GGS (The Generic Game Server)
Black and white chess development kit. GGS is a platform for a variety of chess game competitions on the Internet. ODK is just one of them.
. There are many clients connected to the GGS, and the Windows platform is relatively Lion.
If you already have a black and white chess program, you can connect your program to GGS in 15 minutes, with many programs in the world and
Users conduct a battle.
2, how to use odk? ODK uses a large number of STL libraries in C , such as string classes, versions, graphics, etc. Therefore, the C compiler is a necessary condition using ODK. Reason
On any C compiler, I only use Borland C Builder 6 and Borland C Command Line Compiler.
5.5 Test. As I wrote myself, the MK.BAT content is as follows.
Rem ------------- BCC32 Main Ggetmove GgsMessage GgsObjects GGSstream Odkstream Osmessage OsObjects Sockbufdel * .objdel * .tdsdl * .bakrem -------------
Use the VC's friends to pay attention, select the "Project / Settings ..." menu, turn it back to the "link" page, add WS2_32.lib to your work.
Chengli, otherwise it will not be linked to success. In addition, you need to turn on RTTI, turn it to "C / C " page, select "Category" to "C Language"
, Select "Enable Run-Time Type Information".
You can compile once to confirm that the program can be compiled normally, then there are some places to be modified, soon, you can connect to the GGS.
.
3, how to connect your own program to the GGS? Here you need to modify the two files in the ODK. 1) Main.cpp files in IF (Err = GS.Connect ("EXTERNAL.NJ.NEC.com", 5000) {The server here is changed to opal.cs.ualberta.ca, and the ODK is in the original, But Lion login is Opal.cs.ualberta.ca,
And Lion is indispensable, so it is also a good change.
IF (err = gs.login ("greedy", "password")) {The first parameter here is changed to your username (maximum 8 characters), and the second parameter is changed to your password. Note: I have not tried it in the username.
Whether it can be logged in, if not, you can apply for one by Lion.
2) f (PMSG-> sfrom == "n2") {"N2" here to change your control user name in the odkstream.cpp file. This control username will be explained below.
3) After the above steps are completed, then compile it. If you can run the effect, you should be able to connect to GGS under normal circumstances and display the latest message.
4, how do you make your programs and other users? 1) First, you need to have two users on the GGS, whether you register if it doesn't matter. One is used in the above procedures to log in to the program;
Another use LOON login, this is to control the username, after logging in with LOON, you should be able to see your program username in the user list.
Then you should talk to your program username (you can click on your username) so your program will be based on your instruction.
To act. For example, you enter "TA 8 Ant", wait a moment, your program should start with Ant. After entering "quit",
Wait a moment, you will see your program exit. (Note: Ant is a regular program on GGS, the chess is not strong, but it is not weak. Generally come
Said that users who have just contacted GGS like to fight against it. By the way, my program is named in the GGS is nowcan, if you see it,
You can fight with my program. Of course, now you haven't added your own chess function, but the example in the ODK, so don't
Troubleshoot, your program will definitely win Ant.
2) Add your own smart module to ODK. This is easy, just replace the getMove () function in getMove.cpp. Specific method can
Refer to the code in the ODK. After replacing this function, your program can be connected to GGS. Then look at the next game with Ant.
3) There is a place you need to pay attention to the GGS, although it is not registered, it can be achieved, but it is not possible. And many users - especially
Program users - do not accept matches that do not have achievements. Therefore, the challenge for certain users may not accept the other party, this has no way, only note
book.
5, ODK still has many other details, you can refer to the document included with ODK.
ODK download address: http://vip.6to23.com/nowcan1/ai/odk.rar
Lion download address: http://vip.6to23.com/nowcan1/ai/lion083.zip