XMPP C# Interaction - c#

I am trying to connect via c# and via javascript to an xmpp server (currently ejabberd). Im having a little trouble conceptualizing how the connections will exists.
Backstory: I have a game engine that will take input from the user and send some kind of response back to them. The user may be a windows app, a web app, all needing to connect pretty much the same way. The game engine is a c# application that handles the input accordingly. Is my game engine a user on the xmpp server just like everyone else? How does he talk to the others and vica verca. A detailed tutorial on how this kind of thing is done using xmpp is greatly appreciated if possible.
Are there c# libraries to handle the xmpp connection in the way I specified above? Would the javascript also be hitting the xmpp server in the same way?

Your game server would be an XMPP component which your users could directly communicate with, like they can with any other user, server or component in an XMPP system.
Users log into your server (say example.com) in the standard way, then they can start sending messages of whatever type you like directly to your component (game-engine.example.com). Your game engine component exists separately to your XMPP server and the two communicate using the Jabber Component Protocol. Your client can also send directed presence to the component if you want it to be able to initiate communications.
Though, as you're using ejabberd, you could also implement the game engine messaging system as an ejabberd module.
This probably answers your question about a C# XMPP library: https://stackoverflow.com/questions/1166252/net-xmpp-libraries-under-apache-mit-or-ms-pl-licenses

Related

Client-Server-Clients* gaming system

I am building a multiplayer game in Unity. For that purpose, I have to send some values from client to two or more clients who are connected via a Server.
I want to build it as a server authentic game. Clients will be using Android and their data will be synchronised via a Server (may be some PHP functions or else, I don't know very well).
I can send data to my server from game but How can I send that data to other clients via my Server?
Actually I don't want to sync all players scene (i.e. gameObjects positions which can be done using the Unity's built-in networking or Photon ) because I want to show them different views and This is why I have to make communications among clients via my own Server.
Can anyone please help me out? Any help link or tool name or any kind of tutorial link is highly appreciated.
You need to use WebSocket protocol. It can open bidirectional connection for you so you can push message to your client when you need.
WebSocket protocol in Wikipedia
Unity3d open source websocket plugin
I am successful in doing what I needed. I am using Photon. Using RPC's I am just sending information to clients and In clients, I parsed the information and used it to show them in the game scene. No gameObjects are spawned in Network.
One user creates room, and other joins that room.
Just using RPC's i am syncing the informations.
Thank you all for helping me.

How to use cassia to Create Remote Session and send input?

I know I can use Remote Desktop ActiveX control, but I am trying to implement solution browser based solution just like browserstack.com etc, they have implemented same by using Flash which connects to their server which in turn might be rdp gateway.
I have looked at library Cassia, https://code.google.com/p/cassia/source/browse/trunk/Samples/SessionInfo/Source/SessionInfo/Program.cs, but I am not able to understand how to actually grab the screen and send input after we call WTSStartRemoteControlSession method.
I want to call these methods from an ASP.NET MVC Web Application, which basically stores scripts for automated UI testing. Most of the time, no body will be keeping any UI open, our test server will automatically create RDP session, run everything and then email results.
Only for recording tests, programmers will use Web UI which will communicate with server purely through web sockets and download images of screen. Using ActiveX control is not possible as we use UI Automation to capture text/UI element information etc.
Yeah, Cassia and the WTS API won't help you much here, since they're more for administering servers than interacting with individual sessions.
You could try an HTML5 RDP client like Guacamole. It has a JavaScript client API that allows you to send key and mouse events.
As an alternative, very comparable to Guacamole, you can try Myrtille, also open source and using FreeRDP as rdp client through an HTTP gateway. The main difference is it's done in .NET (C#) and thus is more intended for Windows Servers.

Sending a data from android phone to pc?

I am creating a "tracking system" for my android phone. Basically, the phone would transmit it latitude/longitude to a C# program that will receive the coordinates and display it on a map. I managed to get the phone's latitude/longitude coordinates but I need a way to transmit that data to my C# application running in my PC. I know my way around C# and Java but never really got into network programming. Is there a way to do this ?
I'd look into C# Webservices, very powerful. The communication protocol is SOAP (Simple Object Access Protocol) which is a popular and well supported standard.
Good starting reference: Your first C# Web Service
I can't speak to the C# side of it, but if you write a C# server to receive post requests, the Apache HttpClient makes it relatively simple to send requests. There are a bunch of other questions on SO that will help with setting up the client side on your phone if you poke around a bit.
You have different way to do it.
The first is to send data over the cloud to interact through distant server. So the both devices have to be connected to Internet
The second id to send the data over a local network so the data have to be on the same network and have to share their IPs
The third is to use adb forward which allows to build a socket connection between the 2 devices over a USB cable. The requirements are that the phone have to be on debug mode I think and that the driver are installed on the PC so the phone is recognized by ADB.
I can add one more by using a Bluetooth connection. Find information here
The correct way to do it would be to build WCF service which allows many different protocols to receive data. This would could be a very powerful solution that can be extended in future.
The fastest and easiest IMO would be to create ASP.NET MVC application, define a POCO Model for your longitude/latitude and create an action that would take your Model as parameter. Then use HttpClient and HttpPost on android to send the data. The trick here is to name the variables in your post request same as ones you define in your C# Model.

facebook like chat application in ASP.net

I want to build web based facebook like lightweight chat for my site.
Website build on ASP .net on SQL server 2005.
I am interesetd in XMPP commmunication, but not able to find open source XMPP server with supportedlibrary for C# so that I can create client for my site.
Have checked googling butno luck for C# library; all I could found is plugin and jar.
Is it possible to implement chat logic and XMPP server communication in different language, and accessing thisdata through iframe or by other means on my site.
Thanks,
Hitesh.
http://www.ag-software.de/agsxmpp-sdk/
That library seems to be pretty good.
What you'll want to do is follow jgauffin's suggestion, and use an XMPP library on the backend, and then typically you'd add in a comet server for integration with your web frontend (we've actually done exactly this # Frozen Mountain, using WebSync).
If you're building a smaller site and/or don't need the "realtime" aspect, you could probably get away with polling as well, in which case you'd need to store the results from the XMPP library in your own system, and poll that (since XMPP is strictly event driven).
There are many options to send a message since first human! But how about the intelligence on it, automated collaboration in object level or shared objects among the users etc. I suggest you to take a look for the samples in here and feel the difference.

How to create an IM bot with C#

Is there an easy way to create an IM bot on multiple im networks (aim, gtalk, yim, etc) that can accept and interpet specific commands sent to it to perform a server related task?
Lets say for instance I have a website for managing an rss feed. I want to send a command to an IM bot to add another feed to my collection. the IM bot would associate my screen name with my account from prior setup on the website.
I have done some internal bots for my company using the XMPP (Jabber) protocol, I've used the agsXMPP SDK and the Jabber.NET client libraries, I was looking for APIS to work with YIM, AIM and Windows Live Messenger but I've found only COM exposed APIS, nothing for .NET...
But an idea comes to my mind, with the XMPP Protocol you can configure a local server with IM Gateways, that allow users to access networks using other protocols through your server
I use eJabberd, you can install a variety of transport gateways to connect with other IM protocols (AIM, MSN, ICQ, GTalk...
To GTalk you can connect directly using the libraries I mention...
A sample ICQ gateway:
The short answer to this question is yes this can be done relitivly easily. Sedning and receiving IMs sending, receiving and interpreting requests from the network you wish to communicate on and there are libraries available for each of the major IM protocols to make this easier.
For messenger you can try the DotMsn library, I have used it in the past but at that time it was still quite new and I have not used it since so I can't vouch for it's quality.
Jabber uses the XMMP protocol which is an open-standard so there are bound to be plenty of client libraries available.
If I recall correctly Google Talk uses this protocol or a modified version thereof.
I dont have experience with c# but I have written one for AIM and Gtalk using PHP. http://www.imified.com/ is the best place to start if you looking for a easier way to write an IM bot.
Basically you create an account in imified.com .
Name your bot and link a script.
When ever a message is sent to the bot, imified.com automatically runs this script.
Here is a link for you get you started!
We have professional .NET/COM/VCL library for MSN/Yahoo/ICQ/AIM/GTalk/Jabber. Please take a look at http://www.imcomponents.com/ if you like.

Categories