Forum General Room Type issue

Any issues or discussions relating to Flash development are welcome here.

Room Type issue

Postby Thiezar » March 4th, 2011, 8:22 pm

Hi! I'm brand new to PLAYER.IO. I'm really interested in developing multiplayer flash games and I decided to use this tool.
I'm doing the HELLO WORLD tutorial but it doesn't work for me :-(
It works only if I upload the game code and delete the "development server" line.

Here's the server code:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using PlayerIO.GameLibrary;
using System.Drawing;

namespace MyGame
{
    public class Player : BasePlayer
    {
        public string Name;
    }

    [RoomType("MyGame")]
    public class GameCode : Game<Player>
    {
        public override void GameStarted() { }
        public override void UserJoined(Player player) { }
        public override void UserLeft(Player player) { }

        public override void GotMessage(Player player, Message message)
        {
            player.Send("Hello World");
        }
    }
}


in the Document Class in Flash, if I write the handleConnect function this way:
Code: Select all
private function handleConnect(client:Client):void{
trace("Sucessfully connected to player.io");
client.multiplayer.developmentServer = "127.0.0.1:8184";
client.multiplayer.createJoinRoom("helloworld","",false,{},{},handleJoin,handleError);
}

I got this output:
Code: Select all
Sucessfully connected to player.io
Error: You must specify a server type

so if I specify a server type this way:
Code: Select all
private function handleConnect(client:Client):void{
trace("Sucessfully connected to player.io");
client.multiplayer.developmentServer = "127.0.0.1:8184";
client.multiplayer.createJoinRoom("helloworld","MyGame",false,{},{},handleJoin,handleError);
}

I got this output:
Code: Select all
Sucessfully connected to player.io
Error: Could not find a game class with the correct room type: MyGame. You have to add this attribute: [RoomType("MyGame")] to your main game class. You can read more about this on our blog: http://playerio.com/blog/


But I wrote it!!!!! Where did I go wrong? Please help me, I really want to use PLAYER.IO. It seems great.
Last edited by Thiezar on March 5th, 2011, 12:05 pm, edited 1 time in total.
Try my first Flash Game:
Image
G-Ball
User avatar
Thiezar
 
Posts: 4
Joined: March 4th, 2011, 6:46 pm
Location: Foggia (Italy)

Re:Room Type issue

Postby Thiezar » March 5th, 2011, 11:43 am

Despite of no answers to my post I solved the problem.
I just named bounce the room type in the createJoinRoom function, like tis:
Code: Select all
client.multiplayer.createJoinRoom("test","bounce",false,{},{},handleJoin,handleError);

But why does it works this way? I can't find any documentation for this function, just this but it doesn't help because there isn't a list of aviable room types.
Last edited by Thiezar on March 5th, 2011, 5:40 pm, edited 1 time in total.
Try my first Flash Game:
Image
G-Ball
User avatar
Thiezar
 
Posts: 4
Joined: March 4th, 2011, 6:46 pm
Location: Foggia (Italy)

Re: Room Type issue

Postby HAnz » March 5th, 2011, 3:56 pm

I make games and stuff.
User avatar
HAnz
 
Posts: 46
Joined: August 7th, 2010, 2:59 pm

Re: Room Type issue

Postby Thiezar » March 5th, 2011, 4:19 pm

Of course but this doesn't answer my question. :|
Try my first Flash Game:
Image
G-Ball
User avatar
Thiezar
 
Posts: 4
Joined: March 4th, 2011, 6:46 pm
Location: Foggia (Italy)

Re: Room Type issue

Postby HAnz » March 5th, 2011, 4:52 pm

The bounce room type is always created for a game, that is why it works. My guess would be that your production(development) server isn't using the right dll file containing your MyGame code.

If you follow the steps outlined here: http://playerio.com/documentation/getti ... mbopackage
you should at leats get it to work online, and then you can find the right dll in your production server and develop offline as well.

But if that doesn't help you should really just read and follow the instructions on the links I provided and that should get you up and running in no time. :)
I make games and stuff.
User avatar
HAnz
 
Posts: 46
Joined: August 7th, 2010, 2:59 pm

Re: Room Type issue

Postby Thiezar » March 5th, 2011, 5:39 pm

You were right. I didn't use the correct .dll file. I didn't noticed it because the server loaded a .dll file by itself with the same name as mine :-p
By the way in the tutorials you linked me ( I had this problem just following them as I said so I knew about them :-) ) it's not clearly explained to open the correct .dll file, just to run the server, and it's not explained how to use RoomTypes in the createJoinRoom function.
Anyway thank you :-)
Try my first Flash Game:
Image
G-Ball
User avatar
Thiezar
 
Posts: 4
Joined: March 4th, 2011, 6:46 pm
Location: Foggia (Italy)

Re: Room Type issue

Postby moscoso » January 14th, 2013, 5:19 am

Hey Thiezar,

I have the same exact problem as you. I find it annoying how the tutorials given don't mention these things, it needs to be updated!

Putting "bounce" doesn't work for me and I don't know why.

Can you tell me how did you get the server to download the correct .dll file?
moscoso
 
Posts: 2
Joined: January 14th, 2013, 4:47 am

Re: Room Type issue

Postby Henrik » January 14th, 2013, 11:28 am

In Visual Studio, your test server project, the one you start to start the local gameserver, has a bunch of references. It scans these for an assembly containing gamecode and loads that. If you've moved your gamecode project or want to reference a new project, you need to remove the old reference, and add the new one. You can either browse to the actual .dll of your project, or you can just reference the project if it's in the same solution.

We'll try to get the tutorials and documentation fixed, sorry about that, we're so used to working with Visual Studio that we assume everyone else also knows exactly how .Net assemblies work. :-)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Room Type issue

Postby moscoso » January 15th, 2013, 1:10 am

Thanks for the quick answer. I was able to just browse it. I'm not famiar enough in Visual Studio I guess to adjust references so good thing you guys had that browse feature. I also did not add the game to my account! That's another thing not mentioned in the tutorial but that's fine because the documentation is pretty good. Keep up the good work, keep improving!
moscoso
 
Posts: 2
Joined: January 14th, 2013, 4:47 am


Return to General



cron