/* * Network Control class * * Copyright (C) 2008 Alejandro Valenzuela Roca, * * http://mexinetica.com/~lanjoe9 * * This file is part of MotorJ, a free framework for videogame development. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef NETWORKCTL_CLASS_H #define NETWORKCTL_CLASS_H #ifdef NINTENDO_DS #include #include "../../common/fifomessages.h" #endif #ifdef NINTENDO_WII #include #endif #define MJPOLLINGPORT 62011 enum MJNETCTLSTATUS{ NS_IPCNOTREADY, NS_INACTIVE, NS_WAITINGFORINIT, NS_READYTOASSOCIATE, NS_ASSOCIATING, NS_ASSOCIATED, NS_ASSOCIATIONERROR }; typedef struct { int id; char * name; } mjGameHost; enum MJGAMESTATE{ gsStarting, gsInProgress, gsFinishing, gsCustom}; typedef struct{ int occupied; int total; } mjGameSeats; typedef struct { int sessionID; int gameID; char * gameName; char * sessionName; mjGameHost host; MJGAMESTATE state; mjGameSeats seats; } mjGameSession; class mjNetworkCTL { public: mjNetworkCTL(); #ifdef NINTENDO_DS void AppInitSetIPC(); void dsStartAutoConnect(); void dsContAutoConnect(); void dsDisconnect(); void pollSessions(void); //void getSessions(list_header * sessions); void publishSession(mjGameSession & session); void requestJoin(int sessionID); void leaveSession(); void requestInfo(int sessionID); void startSession(); MJNETCTLSTATUS dsStatus(); private: MJNETCTLSTATUS iStatus; #endif }; #endif