Symbian game programming (3)

xiaoxiao2021-03-05  24

In this chapter, the connection components of the Symbain system are mainly discussed. Connection is very important to the game. (1) Communications Architecture Border = 0> (Communications.gif) As shown above, the Symbian system supports a variety of connection, from Bluetooth to GPRS. The Communications Architecture of the Symbian OS Is Based on top of three CommCnication Servers: Etel, C32 and Esock. The connection service provided by Server is an asynchronous operation, so they need to be packaged in the active object. In general, a client application generates three different activity objects: one is used to send data, one for receiving data and another connection engine as an application side. See below: border = 0> (Communications.gif) where ETEL is a telephone service to provide an interface to an application to access various telephone hardware or services such as GSM Handsets, Analog Modems and Fax Services. This Server uses dynamic loaded plug-in modules, Telephony Server Modules (TSYS). Serial Communications Server (mainly infrared a set of API can be found in the original) Sockets Server The sockets server (ESOCK) provides an interface to communications protocols using sockets. Socket server using the protocol modules, such as TCP / IP, IrDA and Bluetooth, will be in Dynamically loaded during runtime. A protocol module can contain multiple protocols, such as the IRDA module including low-level IRMUX, IRTINYTP, IRLAP, IRLMP, and IROBEX protocols. Common protocol modules can be develop by application developers, correspondinglyl to TSY and CSY modules. The main classes sockets server in the client API is RSocketServ, and RSocket, and RCommServ and RComm similar, RSocketServ handles a session for the server and provides information about Available Protocols, but cannot provide any data transfer services, which are provided by the Socket class RSocket, as the client's API, all protocols are the same, the properties semantic, etc. of a protocol, etc., is maintained by the TProtocoldesc structure. We can use the RSocketServer :: GetProtocolinfo method to access information about the currently loaded protocol. Socket Server requires at least 2 different sockets to complete the function, one is used to listen to the connection request, one is used to establish a connection and transfer data. The client API of Socket Server is defined in the ES_Sock.h header file. A very useful protocol for developers is Bluetooth :) It provides fast, short-distance connectivity solutions. And it can be used free, so many games use it. The advantage of Bluetooth is that it is more stable than the infrared distance.

See related articles or SDK :) Game Data Receiving ------- In order to enable the game to accept game data, S60 allows third-party games to register their data file format through MIME (Multipurpose Internet Mail Extensions) . THE MIME TYPES ARE Used by Communication Applications, Like The WML Browser and The Messaging Application, To Find Out The Path Where A File, Having a Specific Type, Should Be Saved. These files can include new levels, weapons or pictures. In S60, the game's MIME type is: Application / X-NokiaGameData-, here is the last 8 digits of the game in the UID in the Symbian system. This should in symbian MIME type application information file system, aif are described as follows: RESOURCE AIF_DATA {app_uid = 0x12345678; // Application UID datatype_list = {DATATYPE {priority = EDataTypePriorityHigh; type = "application / x-NokiaGame-Data-12345678 ";}};} DataType's priority, indicating how the current program treats these data formats. EDATYPEPRIORITYHIGH indicates that other programs cannot handle this Data Formats. The target path of the file that receives the data is specified in the INI file, the name is .ini. This file should be encoded in Unicode format, which includes sddataDir = , here is the path to the file this path and the default directory of the game data, C: Nokiagames, when the game is After loading, the INI file needs to be copied to the SystemSharedData directory, which can be easily specified in the PKG file of the game. S60 specifies a standard head structure for the game data file and needs to be attached to the MIME type to work. The specific structure is shown below: (GameHeadData.gif) Article Source: http://symbian.org.cn/bbs/viewtopic.php? T = 908

转载请注明原文地址:https://www.9cbs.com/read-38074.html

New Post(0)