Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Shay9999

Pages: [1] 2
1
Network / Socket Unresponsive?
« on: August 13, 2011, 11:10:58 pm »
Thanks Laurent ^_^

2
Network / Socket Unresponsive?
« on: August 12, 2011, 07:50:17 am »
Sorry Laurent, I wrote a false statement.

It has no output once it hits:

Code: [Select]
  if (Listen.Receive(Buffer2, sizeof(Buffer2),Received,Address1,portn) != sf::Socket::Done)
   {
      std::cout<<"Error"<<std::endl;
   }
   else if (Listen.Receive(Buffer2, sizeof(Buffer2),Received,Address1,portn) == sf::Socket::Done)
   {
      std::cout<<"Message From:"<<std::endl;
      std::cout<<Address1<<":"<<Listen.GetLocalPort()<<std::endl;
      std::cout<<Buffer2<<std::endl;
   }
   else
      std::cout<<"Unknown Problem";

3
Network / Socket Unresponsive?
« on: August 11, 2011, 12:48:14 am »
sorry for long continuation time, I was completely lost when I posted this. It's a typo, sending to only 1 address (the other program). Address1 is sf::IpAddress, and Address2 is a string.

There is no output. I've done things like

Code: [Select]
if (Listen.Receive(/*etc.*/) == sf::Socket::Error)

and the code is still just completely responsive, as though it's not even looking at the sockets.

And again, sorry for the long reply and thanks for your quick response ^_^ =P

4
Network / Socket Unresponsive?
« on: August 05, 2011, 04:17:24 am »
I'm having some problems with these two programs that seem to be unresponsive after a certain point:

Program 1:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>

int main()
{
unsigned short Port;
sf::IpAddress Address1 = sf::IpAddress::GetPublicAddress();
sf::UdpSocket Socket;
char Buffer[] = "Hi guys!";
std::cin>>Port;
if (Socket.Send(Buffer, sizeof(Buffer), Address2, Port) != sf::Socket::Done)
{
std::cout<<"Socket (Send) Failed to Send"<<std::endl;
}
else if (Socket.Send(Buffer, sizeof(Buffer), Address1, Port) == sf::Socket::Done)
{
std::cout<<"Message sent"<<std::endl;
}
return 0;
}


Program 2:
Code: [Select]
#include <SFML/Network.hpp>
#include <iostream>

int main()
{
unsigned short Port;
sf::IpAddress Address1 = sf::IpAddress::GetPublicAddress();
        std::cin>>Port;
sf::UdpSocket Listen;
if (Listen.Bind(Port) == sf::Socket::Done)
{
std::cout<<"Successfully bound to Port: "<<Port<<std::endl;
}
unsigned short portn = Listen.GetLocalPort();

std::size_t Received;
char Buffer2[128];
if (Listen.Receive(Buffer2, sizeof(Buffer2),Received,Address1,portn) != sf::Socket::Done)
{
std::cout<<"Error"<<std::endl;
}
else if (Listen.Receive(Buffer2, sizeof(Buffer2),Received,Address1,portn) == sf::Socket::Done)
{
std::cout<<"Message From:"<<std::endl;
std::cout<<Address1<<":"<<Listen.GetLocalPort()<<std::endl;
std::cout<<Buffer2<<std::endl;
}
else
std::cout<<"Unknown Problem";
return 0;
}



These are just snippings from the code, so if there's an error, it's probably me doing bad copy/pasting. Anyways, the send program seems to work fine, but the Listen program becomes unresponsive when it hits the .Receive...

So, what am I doing wrong?

5
Network / No sockets?
« on: July 28, 2011, 02:12:28 am »
Thank you ^_^

and sorry, I'm kinda weird

6
Network / No sockets?
« on: July 27, 2011, 11:36:55 pm »
I don't seem to have the sf::SocketUDP function on my Vis C++. I have sf::Socket, but this doesn't do the same effect as the tutorial was nudging me toward. Is there another function I can use?

7
General / Loading Resource
« on: July 23, 2011, 03:11:47 am »
Thank you!

8
General / Loading Resource
« on: July 22, 2011, 08:18:50 pm »
Actually, it might just be easier (if this is even possible) to put all the .dll files into the .exe file.

is this possible? Is there a way I can take my resources (.dll files, pictures, etc.) and put them into my application?

9
General / Loading Resource
« on: July 22, 2011, 07:41:35 pm »
I would like them to be in a folder where my program would be:

MyProgram\ProgramFiles\DLLs

So the full link would be something like

C:\Program Files(x86)\MyCompany\MyProgram\ProgramFiles\DLLs

10
General / Loading Resource
« on: July 22, 2011, 04:22:43 am »
I'm having this issue with a project I'm doing and I'm unsure on how to do it.

When the program is finished, the files and libraries will be loaded from another folder (when they are needed). However, I have little to know knowledge on how to do this and I was wondering if anyone had a clue as to what to do ^_^

This is what I currently have (and what currently does not work):

Code: [Select]
LoadResource("\\system\\sfml-window-2.dll");
LoadResource("\\system\\sfml-window-d-2.dll");


I assume that it's because I'm supposed to use some other line of code with this, but MSDN is just not helpful >_< I need an example >_<.

All help is appreciated ^_^

11
Window / Disabling Re-size
« on: July 18, 2011, 08:59:23 pm »
Quote from: "Groogy"
Maybe you should be sober while programming? After all it's a brain activity.


Yeah, good point...

Quote from: "Shay9999"
no worky. What's wrong? Be back latez.


Wow, I sound like the freaks I make fun of.

Quote from: "thePyro_13"
Styles don't need  to equal anything, they just are.

Code: [Select]
sf::RenderWindow Window(Program, "My Program", sf::Style::Resize, 0);

Try out all the different styles by compiling and changing the style between Resize and the other options, you'll quickly see how it works, and what the different options do.


Thanks for the sample code <3

I think I got it working now, ty everyone ^_^

12
Window / Disabling Re-size
« on: July 18, 2011, 09:48:53 am »
mmkay, so this is what happened and this is what didn't:

Code: [Select]
sf::RenderWindow Window(Program, "My Program", sf::Style::Resize = 0, 0);


and no worky. What's wrong? Be back latez.

13
Window / Disabling Re-size
« on: July 18, 2011, 09:12:08 am »
I know, but I'm high as fuck

14
Window / Disabling Re-size
« on: July 18, 2011, 08:22:06 am »
Hey, I don't know if this is a function already, I couldn't find it, but is there a way to disable the option to re-size the window? Like, get rid of the maximize button and make it impossible for the user to increase the height and width of the window >_>?

Please respond ^_^

15
Audio / Music Error
« on: June 11, 2011, 11:17:05 pm »
Aww, nevermind, it was a stupid mistake that I don't want to bring up =D

Thanks for the help guys!

Pages: [1] 2