-
Notifications
You must be signed in to change notification settings - Fork 0
/
index28.html
608 lines (601 loc) · 51.9 KB
/
index28.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>IMDagger: Дневник</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Блог IMDagger: IT и жизнь" />
<meta name="keywords" content="python,lisp,scheme,racket,emacs,blender,программирование,моделирование,lua,c++,c,js,java,git,bazaar" />
<meta name="author" content="Alex Moiseenko (IMDagger)" />
<meta name="robots" content="noindex"/>
<!-- Open Graph -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />
<link rel="shortcut icon" href="http://imdagger.github.io/favicon.ico" />
<link rel="stylesheet" href="/theme/css/html4css1.css" />
<link rel="stylesheet" href="/theme/css/style.css" />
<link rel="stylesheet" href="/theme/css/pygment.css" />
<link rel="stylesheet" href="/theme/css/math.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML,http://imdagger.github.io/theme/js/math.js"></script>
<script src="http://s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="/theme/js/selectivizr-min.js"></script>
<noscript><link rel="stylesheet" href="[fallback css]" /></noscript>
<![endif]-->
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="http://imdagger.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="IMDagger Atom-лента" />
</head>
<body>
<div class="row page-head">
<div class="row page-head-status page-head-status-top"><div class="col-sm-12 b-status mine"><p><i></i><a href="#" title="настроение" class="b-consistent-link"><b>Продать кому-то что-то всегда на деле сложнее, чем кажется</b></a></p></div></div>
<div class="col-sm-2 page-left">
<a href="#">
<img src="http://upics.yandex.ru/22199227/normal" ilo-full-src="http://upics.yandex.ru/22199227/normal">
</a>
</div>
<div class="col-sm-10 all-posts">
<div class="title-container">
<h1><b><a href="http://imdagger.github.io" class="fn nickname">IMDagger</a></b></h1>
</div>
<div class="title-menu">
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#">Дневник</a>
</li>
<li><a href="http://fotki.yandex.ru/users/imdagger">Фотки</a></li>
<li><a href="http://imdagger.github.io/pages/o-sebe.html">О себе</a></li>
<li><a href="http://imdagger.github.io/pages/rss-lenta.html">RSS-лента</a></li>
</ul>
</div>
</div>
</div>
<div class="row page-body">
<div class="col-sm-2 page-left">
<div class="row widget widget-photo">
<a href="posts/2011/08/07/aga-popalsia/" class="b-user-photo__link"><img class="b-user-photo__img" src=" http://img-fotki.yandex.ru/get/5409/22199227.a/0_625fc_e780ccc7_L
?log_nocount=64720402854"></a>
</div><div class="row widget">
<div class="widget-content b-user-info">
<div class="widget__body">
<div class="widget-user-info__age">
<i class="widget-user-info__sex widget-user-info__sex_type_"></i> 27 лет
</div>
<div class="widget-user-info__place">
<a href="#">Гомель</a>, <a href="#">Беларусь</a> </div>
<ul class="contacts">
<li class="contact contact-type-email"><i></i><a href="mailto:[email protected]">[email protected]</a></li>
<li class="contact contact-type-ya-online"><i></i>[email protected]</li>
<li class="contact contact-type-icq"><i></i>350395088</li>
</ul>
</div>
</div>
</div>
<div class="row widget">
<div class="widget-content">
<div class="widget__title">
<div class="widget__title-link">Метрика</div>
</div>
<div class="widget__body">
<div class="widget-line">
<!-- noindex -->
<!-- googleoff: index -->
<div class="widget-entry">
<!-- Yandex.Metrika informer --><a href="https://metrika.yandex.ru/stat/?id=25746494&from=informer" target="_blank" rel="nofollow"><img src="//bs.yandex.ru/informer/25746494/3_1_FFFFFFFF_EFEFEFFF_0_pageviews" style="width:88px; height:31px; border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)" onclick="try{Ya.Metrika.informer({i:this,id:25746494,lang:'ru'});return false}catch(e){}"/></a><!-- /Yandex.Metrika informer --><!-- Yandex.Metrika counter --><script type="text/javascript">(function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter25746494 = new Ya.Metrika({id:25746494, clickmap:true, trackLinks:true, accurateTrackBounce:true}); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks");</script><noscript><div><img src="//mc.yandex.ru/watch/25746494" style="position:absolute; left:-9999px;" alt="" /></div></noscript><!-- /Yandex.Metrika counter -->
<!-- googleon: index -->
<!-- /noindex -->
</div>
</div>
</div>
</div>
</div><div class="row widget">
<div class="widget-content">
<div class="widget__title">
<div class="widget__title-link">Популярное в дневнике</div>
</div>
<div class="widget__body">
<div class="widget-line">
<div class="widget-entry">
<div class="widget-day__title">25 июня</div>
<div class="widget-entry clearfix">
<div class="widget-entry__item">
<div class="widget-entry__title">
<a href="#" class="h-link"> Висцеральная теория сна выглядит стр…</a>
</div>
<div class="widget-entry__info">2 ответа</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div>
<div class="col-sm-10 all-posts">
<div class="row b-post-filter">
<span class="pull-right">
записи по
<div class="btn-group">
<span type="button" class="pseudo-link" data-toggle="dropdown">месяцам</span>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li><a rel="nofollow" href="#" class="h-link">Нулябрь</a><li>
<li><a rel="nofollow" href="#" class="h-link">Первябрь</a><li>
</ul>
</div> ·
<div class="btn-group">
<span type="button" class="pseudo-link" data-toggle="dropdown">меткам</span>
<ul class="dropdown-menu dropdown-menu-right" role="menu"> <li> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/emacs.html" class="h-link">emacs</a> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/javascript.html" class="h-link">javascript</a> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/icfpc.html" class="h-link">icfpc</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/blender.html" class="h-link">blender</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/ia.html" class="h-link">Я</a> </li> <li> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/google.html" class="h-link">google</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/zhizn.html" class="h-link">жизнь</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/oshibka.html" class="h-link">ошибка</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/rabota.html" class="h-link">работа</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/python.html" class="h-link">python</a> </li> <li> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/java.html" class="h-link">java</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/bredni.html" class="h-link">бредни</a> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/racket.html" class="h-link">racket</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/programmirovanie.html" class="h-link">программирование</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/bge.html" class="h-link">bge</a> </li> <li> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/eda.html" class="h-link">еда</a> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/linux.html" class="h-link">linux</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/nabrosok.html" class="h-link">набросок</a> <a rel="nofollow" class="tag-1" href="http://imdagger.github.io/tag/radost.html" class="h-link">радость</a> <a rel="nofollow" class="tag-2" href="http://imdagger.github.io/tag/iandeks.html" class="h-link">Яндекс</a> </li> </ul>
</div> ·
<div class="btn-group">
<span type="button" class="pseudo-link" data-toggle="dropdown">типам</span>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li><a rel="nofollow" href="http://imdagger.github.io/category/description.html" class="h-link">обращение</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/friend.html" class="h-link">дружба</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/join.html" class="h-link">клубы</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/link.html" class="h-link">ссылки</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/mood.html" class="h-link">настроение</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/photo.html" class="h-link">фото</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/text.html" class="h-link">текст</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/video.html" class="h-link">видео</a><li>
<li><a rel="nofollow" href="http://imdagger.github.io/category/wishlist.html" class="h-link"></a><li>
</ul>
</div>
</span>
</div>
<div class="row b-post">
<div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/28/fiks-dlia-pyamf/" >
28 апреля 2012 года, 01:34
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/__amf__.html">__amf__</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/synonym.html">synonym</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/ispravlenie.html">исправление</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/python.html">python</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/oshibka.html">ошибка</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/pyamf.html">pyamf</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/04/28/fiks-dlia-pyamf/">Фикс для PyAMF</a> </div>
<div class="row post-body">
<div class="b-text">
<p> Нашёл проблему в PyAMF, которая мешает нормально работать с
десериализованными из AMF объектами, которые содержат правило synonym в
__amf__, при сериализации оно работает нормально, а вот в обратную
сторону нет. Т.к. это касалось рабочего проекта и исправление нужно
здесь и сейчас, то не дожидаясь пока его исправят разработчики, я
поправил сам. Просто форкнул репозиторий проекта и исправил
<a class="reference external" href="https:/IMDagger/pyamf">тут</a>. Чуть позже отправлю
pull-запрос разработчикам, надеюсь они примут мои исправления. Т.к. это
была явная ошибка в тесте и проблема с copy&paste в коде.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/22/flash-socket-blokirovalsia-antivirusami/" >
22 апреля 2012 года, 10:02
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/antivirus.html">антивирус</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/flash.html">flash</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/programmirovanie.html">программирование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/soket.html">сокет</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/rabota.html">работа</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/04/22/flash-socket-blokirovalsia-antivirusami/">Flash socket блокировался антивирусами</a> </div>
<div class="row post-body">
<div class="b-text">
<p> Неожиданная проблема с тем, что у некоторых игроков не отображались
обновления, разрешилась. Сузив круг виновных приложений и платформ,
выяснилось, что это антивирус. При чём Kaspersky и Avast себя вели
достаточно одинаково — блокировали запрос из Flash без каки-либо
собщений пользователю и отметов в журнале событий. Такое молчаливое
поведение достаточно странно. Но после продолжительных поисков
выяснилось, что достаточно сменить порт для соединения с 80-го. В nginx
было выставлено дополнительно слушать 81-ый порт. После этого проблема с
Flash и его socket соединением решилась.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-mood">
<div class="panel-heading b-post-type b-post-type-mood">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
поделился настроением <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/19/urn:ya.ru:post/22199227/1580/" >
19 апреля 2012 года, 00:09
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
</noindex>
<div class="post-title">
</div>
<div class="row post-body">
<div class="b-text">
<p>надеюсь будут перемены</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/19/celery-dlia-igrovogo-mira/" title="изменено 19 апреля 2012 года в 00:08">
19 апреля 2012 года, 00:07
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/celery.html">Celery</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/igra.html">игра</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/multipleer.html">мультиплеер</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/gevent.html">gevent</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/mikropotok.html">микропоток</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/python.html">python</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/04/19/celery-dlia-igrovogo-mira/">Celery для игрового мира</a> </div>
<div class="row post-body">
<div class="b-text">
<p> Надесь Celery в режиме gevent сможет выступить в роли менеджера
задач игровых миров, было бы неплохо из WEB-части порождать отдельную
задачу, которая обслуживает и обновляет состояние игрового мира в Redis.
Т.е. по небольшой группе микропотоков на игровой мир, где будут
существовать игроки и отправлять в него события. Эдакая модель акторов
на Python с супервизором Celery.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/14/podruzhil-textureatlas-assetmanager-i-multizagruzku/" title="изменено 14 апреля 2012 года в 01:49">
14 апреля 2012 года, 01:48
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/programmirovanie.html">программирование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/libgdx.html">libGDX</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/menedzher.html">менеджер</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/resursy.html">ресурсы</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/platformy.html">платформы</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/unifikatsiia.html">унификация</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/atlas.html">атлас</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/04/14/podruzhil-textureatlas-assetmanager-i-multizagruzku/">Подружил TextureAtlas, AssetManager и мультизагрузку</a> </div>
<div class="row post-body">
<div class="b-text">
<p>Одним из преимуществ libGDX является то, что реально писать
приложение на PC, отлаживать большую часть приложения на PC без
эмулятора смартфона. Но есть особенность в том, где ищет библиотека
ресурсы на PC платформе и на Android. <code class="code">
Gdx.files.internal</code>
для PC ищет
данные начиная с корня приложения, а на платформе Android начиная с
директории assets.</p>
<p>Это создаёт небольшие неудобства для унификации и отладки. Хотелось
бы свободно заливать, запускать и не думать сильно о платформе. А ещё
управлять удобно загруженными ресурсами, поддерживать связи между ними,
выгружать. Со всем этим помогает объект класса AssetManager.</p>
<p>Поэтому удобно немного расширить его поведение и указать, где
искать необходимые файлы. Когда я попытался создать свой резолвер и
просто добавлять assets/ для случая PC-платформу, то наткнулся на
проблему с загрузкой TextureAtlas. Сам pack-файл загружался прекрасно, а
вот уже изображения указанные в нём загружались как assets/assets/*,
что было некорректно и не приемлемо. Поэтому пришла простая мысль
проверять начинается ли путь с assets/ и, если это так, то не добавлять
префикс ещё раз:</p>
<div class="highlight"><pre><span class="pgcss-o">...</span>
<span class="pgcss-kd">protected</span> <span class="pgcss-kd">class</span> <span class="pgcss-nc">MultiResolver</span> <span class="pgcss-kd">extends</span> <span class="pgcss-n">InternalFileHandleResolver</span>
<span class="pgcss-o">{</span>
<span class="pgcss-kd">public</span> <span class="pgcss-n">FileHandle</span> <span class="pgcss-nf">resolve</span> <span class="pgcss-o">(</span><span class="pgcss-n">String</span> <span class="pgcss-n">fileName</span><span class="pgcss-o">)</span> <span class="pgcss-o">{</span>
<span class="pgcss-k">if</span> <span class="pgcss-o">(</span><span class="pgcss-n">Gdx</span><span class="pgcss-o">.</span><span class="pgcss-na">app</span><span class="pgcss-o">.</span><span class="pgcss-na">getType</span><span class="pgcss-o">()</span> <span class="pgcss-o">!=</span> <span class="pgcss-n">Application</span><span class="pgcss-o">.</span><span class="pgcss-na">ApplicationType</span><span class="pgcss-o">.</span><span class="pgcss-na">Android</span><span class="pgcss-o">)</span> <span class="pgcss-o">{</span>
<span class="pgcss-k">if</span> <span class="pgcss-o">(!</span><span class="pgcss-n">fileName</span><span class="pgcss-o">.</span><span class="pgcss-na">startsWith</span><span class="pgcss-o">(</span><span class="pgcss-s">"assets/"</span><span class="pgcss-o">))</span>
<span class="pgcss-n">fileName</span> <span class="pgcss-o">=</span> <span class="pgcss-s">"assets/"</span> <span class="pgcss-o">+</span> <span class="pgcss-n">fileName</span><span class="pgcss-o">;</span>
<span class="pgcss-o">}</span>
<span class="pgcss-k">return</span> <span class="pgcss-kd">super</span><span class="pgcss-o">.</span><span class="pgcss-na">resolve</span><span class="pgcss-o">(</span><span class="pgcss-n">fileName</span><span class="pgcss-o">);</span>
<span class="pgcss-o">}</span>
<span class="pgcss-o">}</span>
<span class="pgcss-kd">public</span> <span class="pgcss-kt">void</span> <span class="pgcss-nf">error</span><span class="pgcss-o">(</span><span class="pgcss-n">String</span> <span class="pgcss-n">fileName</span><span class="pgcss-o">,</span> <span class="pgcss-n">Class</span> <span class="pgcss-n">type</span><span class="pgcss-o">,</span> <span class="pgcss-n">Throwable</span> <span class="pgcss-n">throwable</span><span class="pgcss-o">)</span> <span class="pgcss-o">{</span>
<span class="pgcss-n">Gdx</span><span class="pgcss-o">.</span><span class="pgcss-na">app</span><span class="pgcss-o">.</span><span class="pgcss-na">error</span><span class="pgcss-o">(</span><span class="pgcss-s">"RESOURCE"</span><span class="pgcss-o">,</span> <span class="pgcss-s">"Problem with file "</span> <span class="pgcss-o">+</span> <span class="pgcss-n">fileName</span> <span class="pgcss-o">+</span> <span class="pgcss-s">" class "</span> <span class="pgcss-o">+</span> <span class="pgcss-n">type</span> <span class="pgcss-o">+</span> <span class="pgcss-s">" "</span> <span class="pgcss-o">+</span> <span class="pgcss-n">throwable</span><span class="pgcss-o">);</span>
<span class="pgcss-o">}</span>
<span class="pgcss-kd">public</span> <span class="pgcss-nf">MediaLoader</span><span class="pgcss-o">()</span> <span class="pgcss-o">{</span>
<span class="pgcss-n">manager</span> <span class="pgcss-o">=</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">AssetManager</span><span class="pgcss-o">();</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setErrorListener</span><span class="pgcss-o">(</span><span class="pgcss-k">this</span><span class="pgcss-o">);</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">BitmapFont</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">BitmapFontLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">Music</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">MusicLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">Pixmap</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">PixmapLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">Sound</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">SoundLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">TextureAtlas</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">TextureAtlasLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">Texture</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">TextureLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">Skin</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">SkinLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">setLoader</span><span class="pgcss-o">(</span><span class="pgcss-n">TileMapRenderer</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">,</span> <span class="pgcss-k">new</span> <span class="pgcss-nf">TileMapRendererLoader</span><span class="pgcss-o">(</span><span class="pgcss-k">new</span> <span class="pgcss-nf">MultiResolver</span><span class="pgcss-o">())</span>
<span class="pgcss-o">}</span>
<span class="pgcss-o">...</span>
</pre></div>
<p>Возможно есть более красивые и грамотные решения, но меня и это
вполне устраивает. Тем более, что я не собираюсь создавать вложенные
assets директории. В примерах от libGDX перед pack-файлом принудительно
указывают требование на загрузку изображения от этого pack-файла, но
видимо там это сделано лишь для примера, т.к. реальной необходимости в
этом нет.</p>
<div class="highlight"><pre><span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">load</span><span class="pgcss-o">(</span><span class="pgcss-s">"planet/pack"</span><span class="pgcss-o">,</span> <span class="pgcss-n">TextureAtlas</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">);</span>
<span class="pgcss-c1">// ... когда всё загрузилось и готово</span>
<span class="pgcss-n">atlas</span> <span class="pgcss-o">=</span> <span class="pgcss-n">manager</span><span class="pgcss-o">.</span><span class="pgcss-na">get</span><span class="pgcss-o">(</span><span class="pgcss-s">"planet/pack"</span><span class="pgcss-o">,</span> <span class="pgcss-n">TextureAtlas</span><span class="pgcss-o">.</span><span class="pgcss-na">class</span><span class="pgcss-o">);</span>
</pre></div>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-mood">
<div class="panel-heading b-post-type b-post-type-mood">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
поделился настроением <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/14/urn:ya.ru:post/22199227/1576/" >
14 апреля 2012 года, 01:30
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
</noindex>
<div class="post-title">
</div>
<div class="row post-body">
<div class="b-text">
<p>достигнута точка кипения мозга</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/09/nebolshie-zagvozdki-s-soketom/" >
9 апреля 2012 года, 01:26
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/flash.html">flash</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/trudnost.html">трудность</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/programmirovanie.html">программирование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/soket.html">сокет</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/port.html">порт</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/04/09/nebolshie-zagvozdki-s-soketom/">Небольшие загвоздки с сокетом</a> </div>
<div class="row post-body">
<div class="b-text">
<p>Придётся ещё на сервере открыть 843 порт и отдавать там файл
crossdomain.xml, т.к. того требует Flash socket policy, эх… а я думал,
что подводных камней вообще не будет :) Нашёл вот
<a class="reference external" href="http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html">тут</a>,
что и к чему и почему.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-link">
<div class="panel-heading b-post-type b-post-type-link">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
поделился ссылкой <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/04/04/icfpc-2012/" >
4 апреля 2012 года, 01:32
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/sorevnovanie.html">соревнование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/radost.html">радость</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/zhizn.html">жизнь</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/programmirovanie.html">программирование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/icfpc.html">icfpc</a></span></div>
</noindex>
<div class="post-title">
<a class="h-link" href="http://icfpconference.org/icfp2012/">
<img class="b-ico" src="http://favicon.yandex.ru/favicon/icfpconference.org?default=yaru-external">ICFPC 2012</a>
</div>
<div class="row post-body">
<div class="b-text">
<p> Ура! Организаторы ICFP Programming Contest определились с датой
проведения, надеюсь, что с 13 по 16 июля я смогу принять участие в
соревновании, нужно будет ещё подготовиться к этому мероприятию, как
только появится более подробная информация по требованиям.
The ICFP Programming Contest dates have been announced. The contest will
run from Friday 13 July 12:00 GMT to Monday 16 July 12:00 GMT.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/03/31/eksperiment-proshiol-uspeshno/" >
31 марта 2012 года, 02:43
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/programmirovanie.html">программирование</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/radost.html">радость</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/http.html">HTTP</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/python.html">python</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/serializatsiia.html">сериализация</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/pyamf.html">pyamf</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/flash.html">flash</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/rabota.html">работа</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/flex.html">flex</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/03/31/eksperiment-proshiol-uspeshno/">Эксперимент прошёл успешно</a> </div>
<div class="row post-body">
<div class="b-text">
<p> Очень большой поток сообщений через chunked канал мы не проверяли,
но всё работает отлично. События передаются, только, т.к. Flash часть
без Flex, то нужно чтобы списки не передавались как
flex.messaging.io.ArrayCollection, т.к. они только во Flex есть. Поэтому
нужно, чтобы <strong>pyamf.amf3.use_proxies_default</strong> был равен <strong>False</strong>.
Так же стоит выставить заголовки, чтобы промежуточные прокси-сервера,
если таковые имеются не изменяли содержимое и не кэшировали его, т.к.
это всё таки события из игровой системы. И не очень бы хотелось, чтобы
игрок вошёл в игру и случилось дежавю.</p>
<blockquote>
…
Cache-Control: no-cache, no-transform
…</blockquote>
<p> Ещё забавно, когда из браузера обращается к обработчику, то
начинается скачиванием бинарного файла с AMF-объектами, и он может
скачиваться бесконечно.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div><div class="panel panel-text">
<div class="panel-heading b-post-type b-post-type-text">
<b class="b-user">
<a class="b-user__link" href="http://imdagger.github.io/author/imdagger.html"><b class="b-user__first-letter">I</b>MDagger</a>
</b>
написал <span class="pull-right b-date">
<a class="h-link" href="http://imdagger.github.io/posts/2012/03/30/soedinenie-flash-python-amf-i-drugie-tovarishchi/" title="изменено 30 марта 2012 года в 00:26">
30 марта 2012 года, 00:25
</a>
</span>
</div>
<div class="panel-body">
<div class="col-sm-1 b-post__layout-left">
<a href="http://imdagger.github.io/author/imdagger.html"><img src="http://upics.yandex.ru/22199227/middle"></a>
</div>
<div class="col-sm-11 b-right-col">
<noindex>
<div class="row tags-row">
<span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/http.html">HTTP</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/python.html">python</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/flash.html">flash</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/rabota.html">работа</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/chunked.html">chunked</a></span>, <span class="tag"><a rel="nofollow" class="h-link" href="http://imdagger.github.io/tag/wsgi.html">wsgi</a></span></div>
</noindex>
<div class="post-title">
<a class="no-link" href="http://imdagger.github.io/posts/2012/03/30/soedinenie-flash-python-amf-i-drugie-tovarishchi/">Соединение Flash <-> Python, AMF и другие товарищи</a> </div>
<div class="row post-body">
<div class="b-text">
<p> Дабы не строить свой TCP-сервер и не разрабатывать свой протокол для
того, чтобы обмениваться с Flash в <strong>двустороннем порядке</strong> при помощи
AMF-пакетов, мы сошлись на варианте с двумя соединениями. Одно
соединение для получения событий из системы (1), а второй канал (2)
используется через NetConnection и создан для отправки call из Flash. Из
игры отправляется некоторый запрос по каналу (2), который является
HTTP-запросом, соединение удерживается и в рамках одного соединения
происходит много HTTP-запросов. Затем call обрабатывается на сервере и
происходят проверки корректности, событие заносится в очередь или
исполняется сразу же (в зависимости от необходимого времени для
события), ответ возвращается в AMF-формате обратно клиенту.</p>
<p> Затем в системе происходят события, и необходимо оповестить игрока
об этом. Обработчик обслуживающий (2) канал начинает отдавать события по
HTTP клиенту в режиме <em>Transfer-Encoding: chunked</em>, каждый пакет это
одно событие системы. Flash их обрабатывает и отображает игроку.</p>
<p> Такой подход позволил использовать стандартный pywsgi.WSGIHandler из
gevent, при этом получить быстрый канал оповещения с минимальными
накладными расходами. Chunked режим всего требует несколько байт для
отделения длины от пакета и немного символов для описания самой длины в
HEX. Требуется из Flash подключаться при помощи обычного сокета и
пересылать немного HTTP-заголовков для инициализации сессии. Посмотрим
насколько оправдает себя такой подход, чем то напоминает спутниковый
интернет.</p>
</div>
</div>
<div class="row comments-row">
<span><a class="pseudo-link b-candy b-comment-shortcut"><i class="b-ico"></i>ответить</a></span>
</div>
</div>
</div>
</div> <div class="panel panel-default">
<div class="panel-body more">
<span class="less-prev"><a class="h-link" href="http://imdagger.github.io/index27.html">Назад</a></span>
<span class="more-next"><a class="h-link" href="http://imdagger.github.io/index29.html">Ещё записи</a></span>
</div>
</div>
</div>
</div>
</div>
</body>
</html>