| 6 |
|
#include "Flatline_BSL.h" |
| 7 |
|
#include "Flatline.h" |
| 8 |
|
#include "Flatline_Server.h" |
| 9 |
+ |
#include "Mariusnet_Public.h" |
| 10 |
|
bool server_started = 0; |
| 11 |
|
bool client_connected = 0; |
| 12 |
|
int sock = 0; |
| 75 |
|
//TODO: Move this into the client initialization. Doing it like this is silly. |
| 76 |
|
if( NetPlatform_Initalize()) { |
| 77 |
|
static flatline_packet packet; |
| 78 |
< |
sock = NetUDPSocket_Create(27777); |
| 78 |
> |
memset(&client_address, 0, sizeof(sockaddr_in)); |
| 79 |
> |
sock = NetUDPSocket_Create(27777, &client_address); |
| 80 |
|
address.sin_family = AF_INET; address.sin_port = htons(27777); address.sin_addr.S_un.S_addr = inet_addr(args[0].value_str32 ); |
| 81 |
|
//address.sin_family = AF_INET; address.sin_port = htons(27777); address.sin_addr.S_un.S_addr = inet_addr("192.168.0.1"); |
| 82 |
|
|
| 226 |
|
AC->PhyContext->Position.Z += AC->AimVector.Z; |
| 227 |
|
return 0; |
| 228 |
|
} |
| 229 |
+ |
|
| 230 |
+ |
uint16_t ONICALL mnet_login(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 231 |
+ |
{ |
| 232 |
+ |
MSNet_Login(args[0].value_str32, args[1].value_str32); |
| 233 |
+ |
return 0; |
| 234 |
+ |
} |
| 235 |
+ |
|
| 236 |
|
void SLrFlatline_Initialize() |
| 237 |
|
{ |
| 238 |
|
|
| 250 |
|
SLrScript_Command_Register_Void("kick", "Kicks a client from the server", "clientnum:int", kick); |
| 251 |
|
SLrScript_Command_Register_Void("con", "Activates a console", "con:int", con); |
| 252 |
|
SLrScript_Command_Register_Void("ping", "pong!", "", ping); |
| 253 |
+ |
|
| 254 |
+ |
SLrScript_Command_Register_Void("login", "logs into mariusnet", "username:string password:string", mnet_login); |
| 255 |
|
} |