1>------ Build started: Project: unonet, Configuration: Debug Win32 ------
1>Compiling...
1>CardsManager.cpp
1>.\CardsManager.cpp(5) : fatal error C1083: Cannot open precompiled header file: '.\vc_mswd\minimal\minimal.pch': Permission denied
1>chatwindow.cpp
1>.\chatwindow.cpp(4) : fatal error C1083: Cannot open precompiled header file: '.\vc_mswd\minimal\minimal.pch': Permission denied
1>LayoutManager.cpp
1>.\LayoutManager.cpp(8) : fatal error C1083: Cannot open precompiled header file: '.\vc_mswd\minimal\minimal.pch': Permission denied
1>NetworkManager.cpp
1>.\NetworkManager.cpp(6) : fatal error C1083: Cannot open precompiled header file: '.\vc_mswd\minimal\minimal.pch': Permission denied
1>unonet.cpp
1>.\unonet.cpp(9) : fatal error C1083: Cannot open precompiled header file: '.\vc_mswd\minimal\minimal.pch': Permission denied
1>Generating Code...
1>Build log was saved at "file://c:\Users\Sherry\Desktop\uno\vc_mswd\minimal\BuildLog.htm"
1>unonet - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I've combed the internet and have tried some suggestions but still can't get it to work. Someone please help. Here is the code for the unonet.cpp at least. I'm using Visual Studio C++ 2008.
//UNONET game by darshan sonde
//licensed under zlib/png license check readme
#include "unonet.h"
#include "CardsManager.h"
#include "LayoutManager.h"
#include "NetworkManager.h"
#include "Chatwindow.h"
#include <wx/wx.h>
#include <sstream>
using namespace std;
//Create the app load cards and display game window
bool Unonet::OnInit()
{
m_unoWindow = new UnoWindow(_T("UNONET Game"));
m_unoWindow->Show(true);
wxImage::AddHandler( new wxPNGHandler );
m_cards = new CardsManager();
m_layout = new LayoutManager(m_unoWindow);
m_network = new NetworkManager();
m_chatWindow = new ChatWindow(_T("Unonet Chat by darCwader"),m_unoWindow);
m_chatWindow->Show(true);
wxLogWindow *log=new wxLogWindow(m_unoWindow,_T("Debug"),true);
SetTopWindow(m_unoWindow);
return true;
}
IMPLEMENT_APP(Unonet)
BEGIN_EVENT_TABLE(UnoWindow, wxFrame)
EVT_MENU(unoID_NEW_GAME, UnoWindow::onNewGame)
EVT_MENU(unoID_NEW_NETWORK_GAME, UnoWindow::onNewNetworkGame)
EVT_MENU(unoID_QUIT, UnoWindow::onQuit)
EVT_MENU(unoID_PREFERENCES, UnoWindow::onOptions)
EVT_MENU(unoID_ABOUT, UnoWindow::onAbout)
EVT_TIMER(unoID_TIMER, UnoWindow::onTimer)
END_EVENT_TABLE()
UnoWindow::UnoWindow(const wxString &title)
:wxFrame(NULL, wxID_ANY, title),m_timer(this,unoID_TIMER)
{
//create the menu
wxMenu *fileMenu = new wxMenu;
fileMenu->Append(unoID_NEW_GAME, _T("New Game\tCtrl-N"));
fileMenu->Append(unoID_NEW_NETWORK_GAME, _T("New Network Game\tCtrl-W"));
fileMenu->Append(unoID_QUIT, _T("Quit\tCtrl-Q"));
wxMenu *settingsMenu = new wxMenu;
//settingsMenu->Append(unoID_PREFERENCES, _T("Options...\tCtrl-O"));
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(unoID_ABOUT, _T("About\tF1"));
wxMenuBar *menuBar=new wxMenuBar;
menuBar->Append(fileMenu,_T("&File"));
//menuBar->Append(settingsMenu,_T("&Settings"));
menuBar->Append(helpMenu,_T("&Help"));
SetMenuBar(menuBar);
CreateStatusBar(1);
m_timer.Start(300);
}
UnoWindow::~UnoWindow()
{
}
void UnoWindow::onNewGame(wxCommandEvent &WXUNUSED(event))
{
cout<<"\nMenu: onNewGame";
bool gameStarted=wxGetApp().getLayoutManager()->getGameStarted();
if(gameStarted)
{
int answer = wxMessageBox("Resign Current game?", "Confirm",
wxYES_NO | wxCANCEL, this);
if (answer != wxYES)
return;
}
wxGetApp().getLayoutManager()->setGameStarted(true);
CardsManager *cards=wxGetApp().getCardsManager();
cards->initDeck();
Card tmp=cards->getCardFromDeck();
cards->topCard = tmp;
//TODO:topcard color has to be handled
if(tmp.color==0)
cards->topCardColor=1;
else
cards->topCardColor=tmp.color;
for(int i=0;i<7;i++)
{
tmp = cards->getCardFromDeck();
cards->putCard(tmp);
}
//send 7 cards for each user connected
// user newgame nCards <pos> <offset> <color>...
NetworkManager *network=wxGetApp().getNetworkManager();
network->turn=0;
if(network->isServer())
{
int nPlayers=wxGetApp().getNetworkManager()->getNPlayers();
for(int i=0;i<nPlayers;++i)
{
stringstream ss;
wxLogMessage("ss is cleared... ");
ss<<network->getPlayer(i)<<" newgame 7 ";
for(int i=0;i<7;i++)
{
tmp = cards->getCardFromDeck();
ss<<tmp.position<<" "<<tmp.offset<<" "<<tmp.color<<" ";
}
wxLogMessage("sending %s",ss.str().c_str());
network->getServer()->RPC("netsend",ss.str().c_str(),(strlen(ss.str().c_str())+1)*8,
HIGH_PRIORITY, RELIABLE_ORDERED, 0, UNASSIGNED_PLAYER_ID,
true, false, UNASSIGNED_OBJECT_ID);
}
//send topcard // 4) move topPos topOffset topCol penalty
stringstream ss;
ss<<"dummyName move "<<cards->topCard.position<<" "<<cards->topCard.offset<<" "<<cards->topCard.color<<
" "<<wxGetApp().getLayoutManager()->getPenalty()<<" "<<cards->topCardColor;
network->getServer()->RPC("netsend",ss.str().c_str(),(strlen(ss.str().c_str())+1)*8,
HIGH_PRIORITY, RELIABLE_ORDERED, 0, UNASSIGNED_PLAYER_ID,
true, false, UNASSIGNED_OBJECT_ID);
}
Refresh(true);
}
void UnoWindow::onNewNetworkGame(wxCommandEvent &WXUNUSED(event))
{
cout<<"\nMenu: onNewnetworkGame";
wxGetApp().getLayoutManager()->setGameStarted(false);
NetworkManager *network=wxGetApp().getNetworkManager();
//get server or client choice
wxArrayString choices;
choices.Add(_T("Server"));
choices.Add(_T("Client"));
wxString chose=wxGetSingleChoice(_T("Choose..."),_T("UNO"),choices);
if(chose.Length()==0)
return;
wxString name= wxGetTextFromUser(_T("Enter your name"), _T("Nick"));
if(name.Length()==0)
{
network->name=0;
return;
}
else
{
char *str = new char[20];
strcpy(str,(char *)name.c_str());
network->name = str;
}
if(chose.Cmp(_T("Server"))==0)
network->startServer();
else
{
//get ip address
wxString ip= wxGetTextFromUser(_T("Enter the server ip"), _T("ENTER IP ADDRESS"));
if(ip.Cmp(_T(""))==0)
ip=_T("127.0.0.1");
network->startClient((char *)ip.c_str());
}
}
void UnoWindow::onQuit(wxCommandEvent &WXUNUSED(event))
{
Close(true);
}
void UnoWindow::onOptions(wxCommandEvent &WXUNUSED(event))
{
cout<<"\nMenu: onOptions";
}
void UnoWindow::onAbout(wxCommandEvent &WXUNUSED(event))
{
wxMessageBox(_T("game design and development By \nDarshan M Sonde\n\n")
_T("cards design by camille roux\n\nTo use the game you have to start a server or client\n to get your ip, goto whatismyipaddress.com")
_T("\nTo play you need to start atleast 1 server, to which atleast 1 client shud connect and server shud give NEW GAME"));
}
void UnoWindow::onTimer(wxTimerEvent &WXUNUSED(event))
{
wxGetApp().getNetworkManager()->processPackets();
}
//
This post has been edited by wild494: 03 March 2010 - 05:30 PM

New Topic/Question
Reply




MultiQuote






|