00001 /* 00002 * $Id: Protocol.cpp,v 1.4 2002/08/09 09:32:36 virtualcasino Exp $ 00003 */ 00004 #include<Protocol.h> 00005 #include<version.h> 00006 #include<licenses.h> 00007 #include<Bingo.h> 00008 00009 Protocol::Protocol(Client &c){ 00010 client = c; 00011 } 00012 00013 bool Protocol::attend(){ 00014 String opcion; 00015 if(handShake()){ 00016 //If the handshake succeds we're fine, LETS WORK!!!! :-) 00017 client << "1 Bingo, 2 Ruleta, 3 BlackJack, 4 Request BingoCard"; 00018 client >> opcion; 00019 cout << opcion << endl; 00020 if(opcion == "1"){ 00021 } 00022 else if(opcion == "2"){ 00023 } 00024 else if(opcion == "3"){ 00025 } 00026 else if(opcion == "4"){ 00027 provideCard(client); 00028 } 00029 } 00030 else{ 00031 return false; 00032 } 00033 return true; 00034 } 00035 00036 Platform Protocol::getPlatform(){ 00037 Platform os; 00038 client << GETPLATFORM; 00039 client >> (int)os; 00040 return os; 00041 } 00042 00043 bool Protocol::handShake(){ 00044 return true; 00045 } 00046 00047 bool Protocol::authenticateClient(){ 00048 int i, j; 00049 String key; 00050 client << AUTHENTICATE; 00051 client >> key; 00052 for(i = 0, j = NUM_LICS -1; i < NUM_LICS; i++){ 00053 // BINARY SEARCH :-) 00054 if(key == LIC_DATA[i] || key == LIC_DATA[j]) 00055 return true; 00056 } 00057 return false; 00058 } 00059 00060 /*Protocol::{ 00061 } 00062 00063 Protocol::{ 00064 } 00065 00066 Protocol::{ 00067 } 00068 00069 Protocol::{ 00070 } 00071 00072 Protocol::{ 00073 } 00074 00075 Protocol::{ 00076 } 00077 00078 Protocol::{ 00079 } 00080 00081 Protocol::{ 00082 } 00083 00084 Protocol::{ 00085 } 00086 00087 Protocol::{ 00088 } 00089 00090 */ 00091
Powered by: