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)


Return to General