]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Changed name to be less egotistical
authorBrian Bosak <webadm@elcnet.servehttp.com>
Fri, 9 Aug 2013 18:35:59 +0000 (13:35 -0500)
committerBrian Bosak <webadm@elcnet.servehttp.com>
Fri, 9 Aug 2013 19:57:08 +0000 (14:57 -0500)
cl_main.c
host.c
idwmaster_gameroom.c [deleted file]
idwmaster_gameroom.h [deleted file]
makefile.inc

index 1840839dfafc38751fa485ffad30c51b4864d7bd..a05da15facc0d441e4a80193d87666012c56be40 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "r_shadow.h"
 #include "libcurl.h"
 #include "snd_main.h"
-#include "idwmaster_gameroom.h"
+#include "lobby_gameroom.h"
 // we need to declare some mouse variables here, because the menu system
 // references them even when on a unix system.
 
@@ -2442,7 +2442,7 @@ void CL_Init (void)
        Cmd_AddCommand ("stop", CL_Stop_f, "stop recording or playing a demo");
        Cmd_AddCommand ("playdemo", CL_PlayDemo_f, "watch a demo file");
        Cmd_AddCommand ("timedemo", CL_TimeDemo_f, "play back a demo as fast as possible and save statistics to benchmark.log");
-       IDWMaster_Init();
+       lobby_Init();
        // Support Client-side Model Index List
        Cmd_AddCommand ("cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
        // Support Client-side Sound Index List
diff --git a/host.c b/host.c
index 3828c8b066c0d58349b71c26a1e293b8419a0566..73e2e0c046a8f699c3057042aaa318aecfcd5d3c 100644 (file)
--- a/host.c
+++ b/host.c
@@ -764,7 +764,7 @@ void Host_Main(void)
                if (sv.active && !svs.threaded)
                        NetConn_ServerFrame();
                //TODO: IDW main loop
-               IDWMaster_Loop();
+               lobby_Loop();
                Curl_Run();
 
                // check for commands typed to the host
diff --git a/idwmaster_gameroom.c b/idwmaster_gameroom.c
deleted file mode 100644 (file)
index 1710892..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * idwmaster_gameroom.c
- *
- *  Created on: Aug 7, 2013
- *      Author: IDWMaster
- */
-
-
-#include "quakedef.h"
-#include "lhnet.h"
-#include "console.h"
-#include <sys/socket.h>
-#include <sys/types.h>
- #include <arpa/inet.h>
-#include <netinet/in.h>
-#include "thread.h"
-typedef struct {
-       char* hostname;
-       int port;
-       void(*connectDgate)(int);
-} hostinfo;
-
-static mempool_t* idwpool;
-static int callback(void* ptr) {
-       hostinfo* ifo = (hostinfo*)ptr;
-       struct sockaddr_in client;
-
-       memset(&client,0,sizeof(client));
-       client.sin_addr.s_addr = inet_addr(ifo->hostname);
-       client.sin_port = htons(ifo->port);
-       client.sin_family = AF_INET;
-       int sock = socket(AF_INET,SOCK_STREAM,0);
-       int status;
-       if((status = connect(sock,(struct sockaddr_t*)&client,sizeof(client))) <0) {
-               Con_Printf("Connect failed (code %i).\n",status);
-       }else {
-               ifo->connectDgate(sock);
-       }
-
-       Mem_Free(ifo->hostname);
-       Mem_Free(ifo);
-       return 0;
-}
-
-static void TCPConnect(const char* hostname, int port, void(*connectDgate)(int)) {
-       hostinfo* ptr = (hostinfo*)Mem_Alloc(idwpool,sizeof(hostinfo));
-       ptr->connectDgate = connectDgate;
-       ptr->hostname = Mem_Alloc(idwpool,strlen(hostname)+1);
-       ptr->port = port;
-       memcpy(ptr->hostname,hostname,strlen(hostname)+1);
-       Thread_CreateThread(callback,ptr);
-}
-void IDWMaster_Loop() {
-
-}
-static void msgloop(int sock) {
-       unsigned char buffer[2048];
-       while(recv(sock,buffer,sizeof(buffer),0)>0) {
-               unsigned char* ptr = buffer;
-               if(*ptr == 0) {
-                       Con_DPrint("Server found!");
-               }else {
-                       if(*ptr == 1) {
-                               //Chat message (process)
-                               ptr++;
-                               Con_MaskPrint(CON_MASK_CHAT,(char*)ptr);
-                       }
-               }
-
-       }
-}
-static unsigned char xmitpacket[2048];
-static unsigned char* OpenStream() {
-       return xmitpacket;
-}
-static int32_t* getInt(unsigned char** stream) {
-       int32_t* retval = (int32_t*)*stream;
-       (*stream)+=sizeof(int32_t);
-       return retval;
-}
-static void writeString(const char* data,unsigned char** stream) {
-       size_t sz = strlen(data);
-       memcpy(*stream,data,sz+1);
-       (*stream)+=sz+1;
-
-}
-static int _sock;
-static void xmit(unsigned char** stream) {
-       size_t sz = (*stream-xmitpacket);
-       send(_sock,xmitpacket,sz,0);
-}
-
-static void dosay() {
-       unsigned char* stream = OpenStream();
-       if(Cmd_Argc() >0) {
-               *stream = 1;
-               stream++;
-               writeString(Cmd_Args(),&stream);
-               xmit(&stream);
-       }
-}
-//TODO: Also reference mvm_cmds.c to see how builtins work
-static void onConnected(int sock) {
-_sock = sock;
-Con_Print("Connected to backend! Scanning for servers....\n");
-
-Con_MaskPrint(CON_MASK_CHAT,"Welcome to the lobbyist group.\n");
-unsigned char* stream = OpenStream();
-*stream = 0;
-stream++;
-//4 players total
-*getInt(&stream) = 4;
-//CTF mod
-*getInt(&stream) = 1;
-writeString("CTF",&stream);
-xmit(&stream);
-msgloop(sock);
-}
-static void findroom() {
-       Con_Print("Contacting server...\n");
-       TCPConnect("127.0.0.1",1090,onConnected);
-}
-static void getversion() {
-       Con_Print("IDWMaster Protocol version 0.1 Alpha\n");
-}
-void IDWMaster_Init() {
-
-       idwpool = Mem_AllocPool("IDWMaster",0,NULL);
-       Cmd_AddCommand("dsay",dosay,"Says something");
-       Cmd_AddCommand("idwversion",getversion,"Gets the version of the IDWMaster protocol");
-       Cmd_AddCommand("idwfind",findroom,"Finds a game");
-}
diff --git a/idwmaster_gameroom.h b/idwmaster_gameroom.h
deleted file mode 100644 (file)
index 131400f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * idwmaster_gameroom.h
- *
- *  Created on: Aug 7, 2013
- *      Author: brian
- */
-
-#ifndef IDWMASTER_GAMEROOM_H_
-#define IDWMASTER_GAMEROOM_H_
-void IDWMaster_Init();
-void IDWMaster_Loop();
-
-
-#endif /* IDWMASTER_GAMEROOM_H_ */
index 4254dbc5297ead91d73f66dc301eea4beec44ef9..7912786a6f8672e0745a4ed1ca4f6440af4a053c 100644 (file)
@@ -158,7 +158,7 @@ OBJ_COMMON= \
        wad.o \
        world.o \
        zone.o \
-       idwmaster_gameroom.c
+       lobby_gameroom.c
 
 OBJ_MENU= \
        menu.o \