[文章作者:张宴 本文版本:v1.0 最后修改:2011.06.28 转载请注明原文链接:http://blog.zyan.cc/windows_mstsc/]

  个人不喜欢服务端程序,以 Windows 操作系统作为运行平台,但是,很多时候,迫于环境现状,需要让自己的程序实现跨平台。

  在开发全新的金山游戏运营平台时,发现:虽然大部分游戏,服务端程序运行在 Linux 服务器,但是,仍有例外。几款最近代理的游戏,服务端运行在 Windows 服务器上。西山居开发的游戏,服务端集群架构,既有 Windows 服务器,又有 Linux 服务器。

  点击在新窗口中浏览此图片


  游戏运行系统的 Knose 程序,我最初是在 Linux 下开发的,后来才实现了兼容 Windows 的跨平台版本。

  点击在新窗口中浏览此图片


  在 Linux 下,Knose 为“父子进程+指令处理线程池+独立功能多线程”结构;在 Windows 上,将 Knose 父子进程结构,拆分成了 knose_daemon.exe(Service 服务程序)和 knose.exe(主程序),由 knose_daemon.exe 启动 knose.exe。

  点击在新窗口中浏览此图片


  遇到了问题:按照运营维护需求,knose.exe 以及通过它启动的游戏服务端进程,需要有“窗口界面”,显示在桌面中。而 knose_daemon.exe 是以服务方式运行的,无窗口界面,knose_daemon.exe 启动的 knose.exe,窗口界面没有弹出来。

  为了解决这个问题,我在 install.bat 中,用了 Windows 的 sc 命令,将 knose_daemon.exe 启动为系统服务,“type= interact type= own”设置了“允许桌面与服务交互”。在本机(Windows XP SP3)测试,knose.exe 的窗口界面以及通过它启动的游戏进程窗口界面,都弹出来了。

@echo off
sc create "KingeyesKnose" binPath= "%CD%\knose_daemon.exe" DisplayName= "Kingeyes Knose Daemon" start= auto type= interact type= own
sc description KingeyesKnose "金山游戏运营系统 KingEyes Knose 守护进程。"
sc start KingeyesKnose


  点击在新窗口中浏览此图片


  于是将程序发布到 Windows Server 2003 服务器上,远程桌面连接上去,发现 knose.exe 的窗口界面始终弹不出来。

  后来,同事发现,原来是“远程桌面”惹的祸:

  远程桌面客户端 mstsc 有一个 /console 参数,模式等同于本地终端显示器登录,/console 不会去占用非 /console 远程桌面,远程桌面允许两个正常连接和一个控制台/console方式连接,并且正常连接和 /console 连接的桌面操作不能相互看见,只有通过 /console 参数远程桌面连接到 Windows 2003 服务器,才能够看到弹出的 knose.exe 窗口界面。

  在 Windows XP SP3 以上版本,/console 参数改名为 /admin,需要用 mstsc /admin 启动远程桌面:

  点击在新窗口中浏览此图片

  连上后,终于能够看到由 knose_daemon.exe 启动的 knose.exe 程序窗口,以及由 knose.exe 启动的游戏服务端进程窗口了。





技术大类 » Windows相关 | 评论(70) | 引用(0) | 阅读(63743)
Jessika Email Homepage
2015-3-20 23:11
这些功能我都没有去想过,更不用说运用了 asphalt 8 hack
应用公园 Homepage
2015-11-27 15:15
应用公园提供的是一种app制作服务,也就是说用户通过应用公园可以自行制作APP,根据自身的需求,选择合适的模板添加素材,就可制作出一个专业的且可是运营的app软件,还可以通过后台对应用内容进行管理。
沙缸过滤器 Homepage
2017-12-14 14:19
略懂点,还得实际操作下    沙缸过滤器
office setup Homepage
2020-3-20 23:56
Microsoft office has three versions that you can choose according to your requirements that you want to use, visit http://en-officesetup.com/
sdfาร่sdf Email Homepage
2021-11-10 12:40
对于采用了美国RSA信息安全公司的SecurID双重认证系统的用户来说,psftp、WinSCP等软件就无法使用了。因为SecurID系统包含一个配备液晶显示的令牌(Token),令牌每60秒便能产生一组全新的6位数字密码。用户在登录服务器时,除输入其帐号、密码及私人PIN码外,还需输入显示在令牌上的6位数字,黑客想猜出密码进行入侵几乎是不可能的,但由于psftp、WinSCP等软件无法输入SecurID令牌密码,因而不能进行文件传输。 <a href="https://www.kagider.org/sdfาร่sdf"> sdfาร่sdf</a> sdfาร่sdf
SallieStevens Email
2021-11-10 12:42
Backlinks are links from a page on one website to another. This is important to us and your are giving us a chance and opportunity to help each other. We are hoping to have same goal the future of our. www.chokdeebacarrat.com/ole777
Minecraft Email Homepage
2022-2-22 20:29
Take a look at your first Minecraft Gameplay Pocket Edition gameplay on your mobile devices. connect with millions of Android gamers from around the world on this thrilling 3D adventure in this world made of bricks. Explore a myriad of possibilities in Minecraft while you travel.
分页: 4/4 第一页 上页 1 2 3 4 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]