Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / web / public_php / login / login_service_itf.php
blob2490aa7e1715f1de3c1155082389c49354e345f9
1 <?php
2 /////////////////////////////////////////////////////////////////
3 // WARNING : this is a generated file, don't change it !
4 /////////////////////////////////////////////////////////////////
6 require_once('../tools/nel_message.php');
8 class CLoginServiceWeb extends CCallbackClient
11 function login($userId, $ipAddress, $domainId)
13 $msg = new CMessage;
14 $msg->setName("LG");
17 $msg->serialUint32($userId);
18 $msg->serialString($ipAddress);
19 $msg->serialUint32($domainId);
21 return parent::sendMessage($msg);
26 function logout($userId)
28 $msg = new CMessage;
29 $msg->setName("LO");
32 $msg->serialUint32($userId);
34 return parent::sendMessage($msg);
40 function waitCallback()
42 $message = parent::waitMessage();
44 if ($message == false)
45 return false;
47 switch($message->MsgName)
49 case "LGR":
50 $this->loginResult_skel($message);
51 break;
52 case "LGOR":
53 $this->logoutResult_skel($message);
54 break;
55 default:
56 return false;
59 return true;
63 function loginResult_skel(&$message)
65 $message->serialUint32($userId);
66 $message->serialString($cookie);
67 $message->serialUint32($resultCode);
68 $message->serialString($errorString);
70 $this->loginResult($userId, $cookie, $resultCode, $errorString);
73 function logoutResult_skel(&$message)
75 $message->serialUint32($errorCode);
76 $message->serialString($reason);
78 $this->logoutResult($errorCode, $reason);
82 /////////////////////////////////////////////////////////////////
83 // Copy paste this part of code in your derived class
84 // and implement code to ract to incoming message
85 /////////////////////////////////////////////////////////////////
86 // Return the cookie generated for this user session
87 // Eventualy, return an empty string as cookie in case of error
88 // resultCode : 0 - ok, login success
89 // 1 - invalid user
90 // 2 - user already online, must relog
91 // errorString contain a stringified description in case of error
93 function loginResult($userId, $cookie, $resultCode, $errorString)
97 // Return an error code for the logout attemp
98 // If return is not 0, then reason contains a debug string
99 // Return values : 0 - ok
100 // 1 - invalid user
101 // 2 - user already offline
103 function logoutResult($errorCode, $reason)