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.