📄 zigclient_8h-source.html
字号:
00445 <span class="keywordtype">bool</span> start(<span class="keywordtype">bool</span> enable_socket_polling, <span class="keywordtype">int</span> threads_prio);00446 00447 <span class="comment">//shut down the client. this function takes some time, as it involves sending messages and</span>00448 <span class="comment">//waiting responses.</span>00449 <span class="keywordtype">bool</span> shutdown();00450 00451 <span class="comment">//common constructor code (helper)</span>00452 <span class="keywordtype">void</span> common_inits();00453 00454 <span class="comment">//internal channel reader: ziglet downloader</span>00455 <span class="keywordtype">void</span> ziglet_preparer_channel_reader(<span class="keywordtype">int</span> channel_id, <a class="code" href="classchannel__c.html">channel_c</a> *ch);00456 00457 <span class="comment">//do disconnect thread</span>00458 <span class="keywordtype">void</span> *do_disconnect(<span class="keywordtype">void</span> *code_reason);00459 00460 <span class="comment">//code shared with the "sender thread" for blocking run() and "process_nonblocking()" for run_non_blocking()</span>00461 <span class="keywordtype">void</span> check_send_input_packet();00462 00463 <span class="comment">//bool flag = true when I have all the resource files on my disk, ready for loading</span>00464 <span class="keywordtype">bool</span> client_ziglets_ready;00465 00466 <span class="comment">// running with run_non_blocking()</span>00467 <span class="keywordtype">bool</span> running_nonblocking;00468 00469 <span class="comment">//internal I/O console object</span>00470 <a class="code" href="classconsole__c.html">console_c</a> *con;00471 00472 <span class="comment">//outgoing player key input (and maybe other stuff) buffer</span>00473 <a class="code" href="classbuffer__c.html">buffer_c</a> keyout;00474 <span class="keywordtype">bool</span> keyout_changed; <span class="comment">//player key input changed?</span>00475 mutex_c keyout_mutex; <span class="comment">//mutex for "keyout" (needed - already crashed without it!)</span>00476 00477 <span class="comment">//fps, drawing frequency control</span>00478 <span class="keywordtype">int</span> max_fps;00479 <span class="keywordtype">double</span> min_render_interval;00480 <span class="keywordtype">double</span> fps; <span class="comment">//fps for display</span>00481 00482 <span class="comment">//shutdown timeout</span>00483 <span class="keywordtype">int</span> shutdown_timeout;00484 00485 <span class="comment">//must quit the loop in run()?</span>00486 <span class="keyword">volatile</span> <span class="keywordtype">bool</span> stop_called;00487 00488 <span class="comment">//packet sender thread - this is independent from the input/render thread</span>00489 <span class="keyword">volatile</span> <span class="keywordtype">bool</span> sender_thread_quit;00490 00491 <span class="comment">//sender thread's (or nonblocking process_nonblocking() sender code's) get_time() of last time a </span>00492 <span class="comment">// packet was sent. by zero'ing this, we accelerate the sender thread.</span>00493 <span class="keywordtype">double</span> last_packet_send;00494 00495 <span class="comment">//sender thread's (or nonblocking process_nonblocking() sender code's) buffer for writing the </span>00496 <span class="comment">// outgoing input data</span>00497 <a class="code" href="classbuffer__c.html">buffer_c</a> outgoing;00498 00499 <span class="comment">//gameserver's custom connection data</span>00500 <a class="code" href="classbuffer__c.html">buffer_c</a> gameserver_customdata;00501 00502 <span class="comment">//zigserver's (and zigclient's) NET tick</span>00503 <span class="keywordtype">double</span> net_tick;00504 00505 <span class="comment">//zigserver's UPDATE tick (may be useful)</span>00506 <span class="keywordtype">double</span> sim_tick;00507 00508 <span class="comment">//server timeout - time in seconds that the client tolerates without receiving packets</span>00509 <span class="comment">//from the server.</span>00510 <span class="keywordtype">int</span> cfg_server_timeout;00511 <span class="keywordtype">int</span> cfg_connect_timeout; <span class="comment">// connect-to-server timeout</span>00512 00513 <span class="comment">//time of last packet received from the server</span>00514 <span class="keywordtype">double</span> last_server_packet_time;00515 00516 <span class="comment">//to attend server's ping requests</span>00517 <span class="keywordtype">double</span> server_ping_arrive_time; <span class="comment">//time the server ping arrived</span>00518 NLushort server_ping_id; <span class="comment">//packet id of the server's ping request, if 0, no request pending.</span>00519 <span class="keywordtype">int</span> implicit_ping_modulus; <span class="comment">//to identify incoming implicit ping requests</span>00520 00521 <span class="comment">//my ziglet manager</span>00522 <a class="code" href="classziglet__manager__c.html">ziglet_manager_c</a> ziglet_manager;00523 00524 <span class="comment">//ZIGLET SYNC stuff: ziglet name and version currently being negotiated with server</span>00525 string zigsync_name, zigsync_version; 00526 string zigsync_file; <span class="comment">// last .._FILE_TEST'ed file name for the ziglet/version above</span>00527 NLulong zigsync_file_size; <span class="comment">// size of the filename above</span>00528 NLushort zigsync_file_CRC16; <span class="comment">// CRC16 of the filename above</span>00529 <a class="code" href="classfile__c.html">file_c</a> zigsync_ziglet_path; <span class="comment">// path for saving the ziglet (already with name+version)</span>00530 00531 <span class="comment">//if TRUE, client is busy downloading a file and can't get a new FILE_TEST request</span>00532 <span class="comment">//from server. if it does, the client disconnects</span>00533 atomic_c<bool> zigsync_client_busy;00534 00535 <span class="comment">//default save path for ziglets</span>00536 string ziglets_default_save_path;00537 00538 <span class="comment">//client's timing policy</span>00539 <span class="keywordtype">int</span> timing_policy;00540 00541 <span class="comment">//shutdown() mutex</span>00542 mutex_c shutdown_mutex;00543 00544 <span class="preprocessor">#ifdef ZIGCLIENT_SERIALIZE_CALLBACKS</span>00545 <span class="preprocessor"></span> mutex_c scall; <span class="comment">//mutex for serializing callbacks to the gameclient</span>00546 <span class="preprocessor">#endif</span>00547 <span class="preprocessor"></span>00548 <span class="comment">//thread priorities strategy</span>00549 <span class="keywordtype">int</span> threads_prio;00550 00551 <span class="comment">//configured set_compression value, -999 = magic tag "leave at default"</span>00552 <span class="keywordtype">int</span> compression_config;00553 00554 <span class="comment">//flag to signal shutdown() code that it is being called inside the ~zigclient_c destructor</span>00555 <span class="comment">//important because signals to shutdown() that it cannot call back the application ("game client")</span>00556 <span class="comment">//to notifiy about a disconnection, for instance</span>00557 <span class="keywordtype">bool</span> running_this_destructor;00558 00559 <span class="comment">//the default send message policy configured by set_default_send_message_policy()</span>00560 <span class="keywordtype">int</span> default_send_message_policy;00561 00562 <span class="keyword">private</span>:00563 00564 <span class="comment">//modify the client's net tick.</span>00565 <span class="keywordtype">void</span> set_net_tick(<span class="keywordtype">double</span> tick);00566 00567 <span class="comment">//internal leetnet client</span>00568 client_c *client;00569 };00570 00571 <span class="preprocessor">#endif</span>00572 <span class="preprocessor"></span>00573 </pre></div><hr><address style="align: right;"><small>Generated on Mon Jan 24 21:14:23 2005 for ZIG by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -