NETPLAY:Changed chat sending so it will only send a message if the message size is greater then 0.

OGL:Added a tool tip for the wide screen hack tho its probably wrong
OTHER: Just some clean up of the ///////////////////////////////////'s

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4206 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
death2droid 2009-09-06 00:11:16 +00:00
parent e04c176bba
commit eb9f6cd7a1
3 changed files with 51 additions and 54 deletions

View File

@ -16,9 +16,9 @@
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
///////////////////////////////////////////////////////////////////////////////////////////////// // -----------
// Include // Include
// ッッッッッッッッッッッッッッッッ
#include "stdafx.h" #include "stdafx.h"
#include <iostream> #include <iostream>
#include <vector> #include <vector>
@ -33,26 +33,22 @@
#include "../../Core/Src/ConfigManager.h" #include "../../Core/Src/ConfigManager.h"
#include "FileSystemGCWii.h" #include "FileSystemGCWii.h"
#include "VolumeCreator.h" #include "VolumeCreator.h"
/////////////////////////////////////////////////////////////////////////////////////////////////
namespace FileMon namespace FileMon
{ {
///////////////////////////////////////////////////////////////////////////////////////////////// // -----------
// Declarations and definitions // Declarations and definitions
// ッッッッッッッッッッッッッッッッ
DiscIO::IVolume *OpenISO; DiscIO::IVolume *OpenISO;
DiscIO::IFileSystem *pFileSystem = NULL; DiscIO::IFileSystem *pFileSystem = NULL;
std::vector<const DiscIO::SFileInfo *> GCFiles; std::vector<const DiscIO::SFileInfo *> GCFiles;
std::string ISOFile, CurrentFile; std::string ISOFile, CurrentFile;
bool FileAccess = true; bool FileAccess = true;
/////////////////////////////////////////////////////////////////////////////////////////////////
// -----------
/////////////////////////////////////////////////////////////////////////////////////////////////
// Filtered files // Filtered files
// ッッッッッッッッッッッッッッッッ
bool ShowSound(std::string FileName) bool ShowSound(std::string FileName)
{ {
std::string Ending; std::string Ending;
@ -73,12 +69,11 @@ bool ShowSound(std::string FileName)
return false; return false;
} }
/////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////// // -----------
// Read the GC file system // Read the GC file system
// ッッッッッッッッッッッッッッッッ
void ReadGC(std::string FileName) void ReadGC(std::string FileName)
{ {
GCFiles.clear(); GCFiles.clear();
@ -91,12 +86,10 @@ void ReadGC(std::string FileName)
} }
FileAccess = true; FileAccess = true;
} }
/////////////////////////////////////////////////////////////////////////////////////////////////
// -----------
/////////////////////////////////////////////////////////////////////////////////////////////////
// Check if we should play this file // Check if we should play this file
// ッッッッッッッッッッッッッッッッ
void CheckFile(std::string File, int Size) void CheckFile(std::string File, int Size)
{ {
// Don't do anything if the log is unselected // Don't do anything if the log is unselected
@ -118,12 +111,10 @@ void CheckFile(std::string File, int Size)
// Update the current file // Update the current file
CurrentFile = File; CurrentFile = File;
} }
/////////////////////////////////////////////////////////////////////////////////////////////////
// -----------
/////////////////////////////////////////////////////////////////////////////////////////////////
// Find the GC filename // Find the GC filename
// ッッッッッッッッッッッッッッッッ
void FindFilename(u64 offset) void FindFilename(u64 offset)
{ {
// Don't do anything if the log is unselected // Don't do anything if the log is unselected
@ -149,7 +140,6 @@ void FindFilename(u64 offset)
CheckFile(File, Size); CheckFile(File, Size);
} }
/////////////////////////////////////////////////////////////////////////////////////////////////
} // FileMon } // FileMon

View File

@ -460,39 +460,43 @@ void NetPlay::OnGUIEvent(wxCommandEvent& event)
// TODO : there seems to be a random bug here that i can't reproduce... looked like a loop bug :/ // TODO : there seems to be a random bug here that i can't reproduce... looked like a loop bug :/
wxString chat_str = wxString::Format(wxT("> %s : %s\n"), wxString(m_nick.c_str(), wxConvUTF8).c_str() , m_Chat->GetValue().c_str() ); wxString chat_str = wxString::Format(wxT("> %s : %s\n"), wxString(m_nick.c_str(), wxConvUTF8).c_str() , m_Chat->GetValue().c_str() );
int chat_size = (int)chat_str.size(); int chat_size = (int)chat_str.size();
m_Chat->Clear(); int nick_size = m_nick.size();
if(chat_size-nick_size-6 > 0)
// If there's no distant connection, we write but we don't send
if (m_numClients == 0) {
m_Logging->AppendText(chat_str);
return;
}
// Max size that we handle is 1024, there's no need for more
if ((chat_str.size()+1) * sizeof(char) > 1024) {
m_Logging->AppendText(wxT("ERROR : Packet too large !\n"));
return;
}
// Send to all
if (m_isHosting == 1)
{ {
for (int i=0; i < m_numClients ; i++) { m_Chat->Clear();
// Send Chat command
m_sock_server->Write(i, (const char*)&value, 1); // 0x30 -> Chat // If there's no distant connection, we write but we don't send
if (m_numClients == 0) {
// Send Chat string m_Logging->AppendText(chat_str);
m_sock_server->Write(i, (const char*)&chat_size, 4); return;
m_sock_server->Write(i, chat_str.mb_str(), chat_size + 1); }
// Max size that we handle is 1024, there's no need for more
if ((chat_str.size()+1) * sizeof(char) > 1024) {
m_Logging->AppendText(wxT("ERROR : Packet too large !\n"));
return;
} }
}
else {
m_sock_client->Write((const char*)&value, 1);
m_sock_client->Write((const char*)&chat_size, 4);
m_sock_client->Write(chat_str.mb_str(), chat_size + 1);
}
// Do not wait for the server, just write as soon as sent // Send to all
m_Logging->AppendText(chat_str); if (m_isHosting == 1)
{
for (int i=0; i < m_numClients ; i++) {
// Send Chat command
m_sock_server->Write(i, (const char*)&value, 1); // 0x30 -> Chat
// Send Chat string
m_sock_server->Write(i, (const char*)&chat_size, 4);
m_sock_server->Write(i, chat_str.mb_str(), chat_size + 1);
}
}
else {
m_sock_client->Write((const char*)&value, 1);
m_sock_client->Write((const char*)&chat_size, 4);
m_sock_client->Write(chat_str.mb_str(), chat_size + 1);
}
// Do not wait for the server, just write as soon as sent
m_Logging->AppendText(chat_str);
}
break; break;
} }

View File

@ -255,8 +255,11 @@ void GFXConfigDialogOGL::CreateGUIControls()
wxT("\n\nApplies instanty during gameplay: <Yes>")); wxT("\n\nApplies instanty during gameplay: <Yes>"));
m_2xResolution->SetToolTip(wxT( m_2xResolution->SetToolTip(wxT(
"Applies instanty during gameplay: <Yes, if allowed>")); "Applies instanty during gameplay: <Yes, if allowed>"));
m_WidescreenHack->SetToolTip(wxT( m_WidescreenHack->SetToolTip(
"Applies instanty during gameplay: <Yes>")); wxT("This multiplys a perpective projection value to increase the amount being")
wxT("\nshown instead of stretching the screen, this may cause graphical problems")
wxT("\nin some games")
wxT("\n\nApplies instanty during gameplay: <Yes>"));
m_Crop->SetToolTip( m_Crop->SetToolTip(
wxT("Crop the picture instead of creating a letterbox. It will assume that your screen") wxT("Crop the picture instead of creating a letterbox. It will assume that your screen")
wxT("\nis of the 5:4 format if you have selected the 4:3 aspect ratio. It will assume") wxT("\nis of the 5:4 format if you have selected the 4:3 aspect ratio. It will assume")