Shadowrun: Awakened 29 September 2011 - Build 871
SraClientConnectionTest.cpp
Go to the documentation of this file.
00001 
00006 #include "stdafx.h"
00007 #include "stdio.h"
00008 #include <iostream>
00009 #include <sstream>
00010 #include <memory>
00011 #include <string>
00012 #include <stdexcept>
00013 
00014 extern "C" __declspec(dllexport) int SraLogin(wchar_t* user, wchar_t* pw);
00015 extern "C" __declspec(dllexport) bool SraConnectToServer(wchar_t* serverAddress);
00016 extern "C" __declspec(dllexport) int SraSendMessage(wchar_t* msg);
00017 extern "C" __declspec(dllexport) void SraShutdown();
00018 extern "C" __declspec(dllexport) wchar_t* SraGetZone(int pID);
00019 extern "C" __declspec(dllexport) void testServerForPackageOverflow();
00020 
00021 int _tmain(int argc, _TCHAR* argv[])
00022 {
00023     if (!SraConnectToServer( L"192.168.2.1"))
00024     {
00025         printf("Failed to connect to server\n");
00026         system("Pause");
00027         return 1;
00028     }
00029     wchar_t* user = L"Tharbas";
00030     wchar_t* pw = L"Test";
00031     int userID = SraLogin( user,pw );
00032     printf("userID: %d\n ",userID);
00033     wchar_t *zone = SraGetZone(userID);
00034     if (zone == NULL) {
00035         printf("Connection to server lost\n");
00036     } else {
00037         printf("Zone address : %ls\n", zone);
00038     }
00039     SraShutdown();
00040     system("Pause");
00041     return 0;
00042 }
00043 

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net