1> 00:00:00 +15.000 Hello, world!!!
2< 00:00:00 +15.000 Hello, world!!!
1> 00:00:00 +15.000 Hello, world!!!
2< 00:00:00 +15.000 OK
1> 00:00:00 +15.000 Hello, world!!!
2< 00:00:00 +15.000 Hello, world!!!
1> 00:00:00 +15.000 Hello, world!!!
2< 00:00:00 +15.000 OK
1> 00:00:00 +15.000 Hello, world!!!
2< 00:00:00 +15.000 Hello, world!!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Simple TCP server for playing Tic-Tac-Toe game. | |
| Use Player-to-Player game mode based on naming auth. | |
| No thoughts about distribution or pub/sub mode | |
| (for monitoring or something like this). Just | |
| basic functionality. | |
| """ | |
| import time | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/ | |
| from queue import Queue | |
| from threading import Thread | |
| from functools import partial | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.options |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Include simple random number generator to ensure results will be the | |
| // same cross platform. | |
| // http://en.wikipedia.org/wiki/Park%E2%80%93Miller_random_number_generator | |
| uint32_t lcg_seed = 48271; | |
| uint32_t lcg_rand() { | |
| return lcg_seed = ((uint64_t)lcg_seed * 279470273UL) % 4294967291UL; | |
| } | |
| void lcg_reset() { lcg_seed = 48271; } |
Чомусь не працює HTTPS (та і SSL через TCP/IP). Шо я упускаю?
Шо робив: Увага! Тут збережен токен для Telegram-бота. Я потім його видалю, а пока прохання не ддудосити ;)
- Завантажую кореневий сертифікат для api.telegram.org:
Відкрийте бота @fenix_testuser7_bot
Це можна зробити вставивши у строку пошука в Телеграм @fenix_testuser7_bot
Якшо бот автоматично не написав код для доступа, можна запросити код натиснувши "Меню" -> "/start - Додати систему." Або ввести повідомлення для бота: /start
Бот відповість повідомленням типу: