using quicksilver to mock-up web 3 · 2007. 4. 2. · (supports xna framework & game studio...
TRANSCRIPT
![Page 1: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/1.jpg)
Using QuickSilverto mock-up Web 3.0
Krzys Ostrowski
![Page 2: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/2.jpg)
Introduction
![Page 3: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/3.jpg)
![Page 4: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/4.jpg)
BAD
![Page 5: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/5.jpg)
![Page 6: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/6.jpg)
BAD
![Page 7: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/7.jpg)
![Page 8: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/8.jpg)
![Page 9: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/9.jpg)
![Page 10: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/10.jpg)
![Page 11: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/11.jpg)
![Page 12: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/12.jpg)
![Page 13: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/13.jpg)
Architecture
![Page 14: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/14.jpg)
![Page 15: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/15.jpg)
![Page 16: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/16.jpg)
![Page 17: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/17.jpg)
![Page 18: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/18.jpg)
![Page 19: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/19.jpg)
Tools
![Page 20: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/20.jpg)
Development Environment
• Microsoft Visual Studio 2005 “Express”
(supports XNA Framework & Game Studio Express)
– XNA Project types
– Implements the “content pipeline”
• Microsoft Visual Studio 2005 “Professional”
(support only the XNA Framework)
– Version control,
– Debugging multithreaded applications, etc.
![Page 21: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/21.jpg)
loading content
content
![Page 22: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/22.jpg)
Coding
![Page 23: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/23.jpg)
How to access the functionalityprovided by XNA, QMS etc.
![Page 24: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/24.jpg)
![Page 25: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/25.jpg)
![Page 26: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/26.jpg)
![Page 27: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/27.jpg)
![Page 28: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/28.jpg)
Add a pre-build event to manually copyQuickSilver_0.dll,You can also copy over graphical content here
![Page 29: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/29.jpg)
Where to write your own code
![Page 30: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/30.jpg)
namespace MyGameClient{
public partial class Form1 : Form {
public Form1() {
InitializeComponent(); gamethread = new Thread(new ThreadStart(ThreadCallback)); gamethread.Start();…
![Page 31: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/31.jpg)
public partial class Form1 : Form{
…
private void ClosingCallback(object sender, FormClosingEventArgs e)
{…
}
![Page 32: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/32.jpg)
![Page 33: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/33.jpg)
When does your code run?
![Page 34: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/34.jpg)
Threads
• Game Thread– Rendering graphics– Respond to mouse/keyboard
• Windows Forms Thread– Rendering Forms– Respond to mouse/keyboard
• QSM Thread (inside QSM)
– Network communication
• Your own threads?– Your background processing etc.
Application.Run(new Form1(…));
game = new MyGame(…);game.Run();
client = QS.CMS.Framework2.Client.Create(…);
![Page 35: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/35.jpg)
Your Code
• Your own threads
• Callbacks from Windows Forms (GUI Thread)– Mouse, keyboard etc.
• Callbacks from Game (Game Thread)– Update(GameTime gameTime)
– Draw(GameTime gameTime)
• Callbacks from QSM (QSM Thread)– When packets are received, sent, acked etc.
– Must do minimum work and leave!
![Page 36: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/36.jpg)
How to use QSM
![Page 37: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/37.jpg)
Launching QSM “client”
using QS.CMS.Framework2;
…
ClientConfiguration configuration =
new ClientConfiguration(
“192.168.0.0/24”, 10000, “192.168.0.100”);
configuration.Verbose = true;
…
IClient client = Client.Create(configuration);
select the NICport numberGMS address
![Page 38: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/38.jpg)
Joining a QSM group
IGroup group = client.Open(
new QS.CMS.Base3.GroupID(groupid), GroupOptions.FastCallbacks);
numericidentifier
how QSM interactswith your code
![Page 39: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/39.jpg)
Receiving from a group
group.OnReceive +=
new IncomingCallback(ReceiveCallback);
private void ReceiveCallback(
QS.CMS.Base3.InstanceID sender, QS.CMS.Base3.ISerializable message)
{
Message m = (Message) message;
…
your class
calledonreceive
![Page 40: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/40.jpg)
Sending to a group (1)
group.BufferedChannel.Send(new Message(…));
uses internal buffer to store messages you are sending
you can send thisway from anythread
![Page 41: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/41.jpg)
Sending to a group (2a)
![Page 42: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/42.jpg)
Sending to a group (2b)
group.ScheduleSend(new OutgoingCallback(SendCallback));
private void SendCallback(IChannel channel, uint maxsend, out bool hasmore)
{channel.Send(new Message(…));hasmore = false;
}
unbuffered
max # messages
keep sending?
![Page 43: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/43.jpg)
Serialization
• Built-in XML– Flexible, easy to use
– Slow
– Space-consuming
• Built-in “binary”– Useless
• QSM– Fast, supports scatter-gather I/O
– Takes getting used to…
![Page 44: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/44.jpg)
“traditional” serialization
![Page 45: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/45.jpg)
“scatter-gather” serialization
![Page 46: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/46.jpg)
serialization in QSM
![Page 47: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/47.jpg)
Anatomy of a serializable class (1)
[QS.CMS.Base2.ClassID(Message.ClassID)]
public sealed class Message : QS.CMS.Base3.ISerializable
{
public const ushort ClassID =
(ushort) (QS.ClassID.UserMin + 100);
public Message()
{
}
(1)
(2)
(3)
(4)
![Page 48: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/48.jpg)
Anatomy of a serializable class (2)
unsafe QS.CMS.Base3.SerializableInfoQS.CMS.Base3.ISerializable.SerializableInfo{
get { return
new QS.CMS.Base3.SerializableInfo(ClassID, sizeof(uint) + 2 * sizeof(float));
}}
class identifier header size
(5)
(6)
![Page 49: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/49.jpg)
![Page 50: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/50.jpg)
Anatomy of a serializable class (3)
unsafe void QS.CMS.Base3.ISerializable.SerializeTo(
ref QS.Fx.Base.ConsumableBlock header,
ref IList<QS.Fx.Base.Block> data)
{
fixed (byte* arrayptr = header.Array)
{
byte* headerptr = arrayptr + header.Offset;
*((uint*)headerptr) = playerid;
*((float*)(headerptr + sizeof(uint))) = x;
*((float*)(headerptr + sizeof(uint) + sizeof(float))) = y;
}
header.consume(sizeof(uint) + 2 * sizeof(float));
here you can copy
append your buffers here
(7) (8)
(9)
(10)
![Page 51: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/51.jpg)
How to use WCF
![Page 52: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/52.jpg)
shared class library
referenceWCF DLLs
referenceyour classlib fromclient and server
![Page 53: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/53.jpg)
using System.ServiceModel;
namespace MyGameLib {
[ServiceContract]
public interface IMyGameServer {
[OperationContract]
void JoinTheGame(string myname, byte[] mypicture, out uint myid, out uint groupid);
[OperationContract]
void GetPlayerInfo(uint playerid,
out string playername, out byte[] playerpicture);
}
}
![Page 54: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/54.jpg)
[ServiceBehavior(
InstanceContextMode = InstanceContextMode.Single)]
public partial class Form1
: Form, MyGameLib.IMyGameServer {
public Form1(string subnet) {
…
servicehost = new ServiceHost(this);
servicehost.AddServiceEndpoint(
typeof(MyGameLib.IMyGameServer),
new WSHttpBinding(),
"http://" + Dns.GetHostName() + ":60000");
servicehost.Open();
}
![Page 55: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/55.jpg)
ChannelFactory<MyGameLib.IMyGameServer> servicefactory =
new ChannelFactory<MyGameLib.IMyGameServer>(
new WSHttpBinding(),
new EndpointAddress(
"http://" + serveraddress + ":60000"));
IMyGameServer gameserver =
servicefactory.CreateChannel();
gameserver.JoinTheGame(
playername, picturebytes, out myid, out groupid);
![Page 56: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/56.jpg)
How to use XNA
![Page 57: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/57.jpg)
private Player CreatePlayer(
uint id, string name, byte[] picture,
Vector2 position)
{
Player player = new Player(…,
new SpriteBatch(graphics.GraphicsDevice),
Texture2D.FromFile(graphics.GraphicsDevice,
new MemoryStream(picture)),
…);
…
}
![Page 58: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/58.jpg)
protected override void Draw(GameTime gameTime)
{ graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
foreach (Player player in players.Values)
{
player.sprite.Begin(SpriteBlendMode.AlphaBlend);
player.sprite.Draw(
player.texture, player.position, Color.White);
player.sprite.End();
}
base.Draw(gameTime);
}
![Page 59: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/59.jpg)
How to abuse QSM
![Page 60: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/60.jpg)
![Page 61: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/61.jpg)
References
![Page 62: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/62.jpg)
Software (1)
• Visual Studio 2005 Professional Edition:MSDNAA
• Visual Studio 2005 Express Edition:http://msdn.microsoft.com/vstudio/express/
• XNA Framework, XNA Game Studio Expresshttp://msdn2.microsoft.com/en-us/xna/
• Other:See the tutorial for details (URL on next page)
![Page 63: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/63.jpg)
Software (2)
• QSM:
– The QUickSilver Project webpagehttp://www.cs.cornell.edu/projects/quicksilver/QSM/index.htm
– Download the latest distribution(0.12 as of the time of writing this presentation)
– Report bugs to Krzys
• Remember to include logs (see the tutorial for details)
![Page 64: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/64.jpg)
Tutorials (1)
• Video Tutorials on MSDNhttp://msdn2.microsoft.com/en-us/xna/bb245766.aspx
• MSDN Documentation (three examples)
http://msdn2.microsoft.com/en-us/library/bb203894.aspx(you can find this content also in your local help documentation installed with XNA)
![Page 65: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/65.jpg)
Tutorials (2)
• QSM Tutorial:http://www.cs.cornell.edu/projects/quicksilver/QSM/tutorial/tutorial.html
• QSM API:http://www.cs.cornell.edu/projects/quicksilver/QSM/api/
• QSM User’s Guide:http://www.cs.cornell.edu/projects/quicksilver/QSM/users_guide.htm
![Page 66: Using QuickSilver to mock-up Web 3 · 2007. 4. 2. · (supports XNA Framework & Game Studio Express) –XNA Project types –Implements the ^content pipeline •Microsoft Visual Studio](https://reader035.vdocuments.mx/reader035/viewer/2022071001/5fbe773134eeef67c92e49e6/html5/thumbnails/66.jpg)
Discussion