From: Brian Bosak Date: Mon, 2 Sep 2013 20:02:45 +0000 (-0500) Subject: Added more stuff X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b1273664c3ccb2f721f48f65770b0ed952a48b58;p=xonotic%2Fdarkplaces.git Added more stuff --- diff --git a/lobby_gameroom.c b/lobby_gameroom.c index 6b91737a..c8a45766 100644 --- a/lobby_gameroom.c +++ b/lobby_gameroom.c @@ -188,8 +188,10 @@ static void msgloop(int sock) { room.playercount = *getInt(&ptr); room.playermax = *getInt(&ptr); room.index = *getInt(&ptr); - - + char bigbufferbill[1024*5]; + memset(bigbufferbill,0,sizeof(bigbufferbill)); + sprintf(bigbufferbill,"Found room called %s with %i players out of %i available slots, at index %i.\n",room.name,room.playercount,room.playermax,room.index); + runOnMainThread(printmsg,bigbufferbill); }else { if(*ptr == 1) { ptr++; @@ -237,6 +239,19 @@ static void findroom() { Con_Print("Contacting server...\n"); TCPConnect("50.17.30.158",1090,onConnected); } +static void lobbycon() { + if(Cmd_Argv(0) !=0) { + int val = atoi(Cmd_Argv(0)); + unsigned char* ptr = OpenStream(); + *ptr = 4; + ptr++; + *getInt(&ptr) = val; + xmit(&ptr); + }else { + Con_Print("You must specify a valid index"); + } + +} static void makeroom() { const char* name = Cmd_Args(); if(name == 0) { @@ -298,5 +313,6 @@ void lobby_Init() { Cmd_AddCommand("idwversion",getversion,"Gets the version of the IDWMaster protocol"); Cmd_AddCommand("lobbybind",bindhost,"Registers this server as an available host for the IDWMaster protocol"); Cmd_AddCommand("lobbyfind",findroom,"Finds a game"); + Cmd_AddCommand("lobbyconnect",lobbycon,"Connects to a specified lobby based on index"); Cmd_AddCommand("lobbymake",makeroom,"Makes a new lobby"); }